You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: extensions/2.0/Khronos/KHR_materials_diffuse_transmission/README.md
+65-61Lines changed: 65 additions & 61 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@
11
11
- Alex Wood, AGI [@abwood](https://github.com/abwood)
12
12
- Ed Mackey, AGI [@emackey](https://github.com/emackey)
13
13
14
-
Copyright 2024 The Khronos Group Inc. All Rights Reserved. glTF is a trademark of The Khronos Group Inc.
14
+
Copyright 2025 The Khronos Group Inc. All Rights Reserved. glTF is a trademark of The Khronos Group Inc.
15
15
See [Appendix](#appendix-full-khronos-copyright-statement) for full Khronos Copyright Statement.
16
16
17
17
## Status
@@ -24,12 +24,12 @@ Written against the glTF 2.0 spec.
24
24
25
25
## Exclusions
26
26
27
-
* This extension must not be used on a material that also uses `KHR_materials_pbrSpecularGlossiness`.
28
-
* This extension must not be used on a material that also uses `KHR_materials_unlit`.
27
+
- This extension must not be used on a material that also uses `KHR_materials_pbrSpecularGlossiness`.
28
+
- This extension must not be used on a material that also uses `KHR_materials_unlit`.
29
29
30
30
## Overview
31
31
32
-
This extension models the physical phenomenon of light being diffusely transmitted through an infinitely thin material. Thin dielectric objects like leaves or paper diffusely transmit light due to dense volumetric scattering within the object. In 3D graphics, it is common to approximate thin volumetric objects as non-volumetric surfaces. The KHR_materials_diffuse_transmission extension models the diffuse transmission of light through such infinitely thin surfaces. For optically thick media (volumes) with short scattering distances and dense scattering behavior, i.e. candles, KHR_materials_diffuse_transmission provides a phenomenologically plausible and cost-effective approximation.
32
+
This extension models the physical phenomenon of light being diffusely transmitted through an infinitely thin material. Thin dielectric objects like leaves or paper diffusely transmit light due to dense volumetric scattering within the object. In 3D graphics, it is common to approximate thin volumetric objects as non-volumetric surfaces. The `KHR_materials_diffuse_transmission` extension models the diffuse transmission of light through such infinitely thin surfaces. For optically thick media (volumes) with short scattering distances and dense scattering behavior, i.e. candles, `KHR_materials_diffuse_transmission` provides a phenomenologically plausible and cost-effective approximation.
33
33
34
34
<divalign="center">
35
35
<figurestyle="text-align:center">
@@ -44,43 +44,42 @@ This extension models the physical phenomenon of light being diffusely transmitt
44
44
</figure>
45
45
</div>
46
46
47
-
48
47
## Extending Materials
49
48
50
49
The effect is activated by adding the `KHR_materials_diffuse_transmission` extension to any glTF material.
|**diffuseTransmissionFactor**|`number`| The percentage of non-specularly reflected light that is diffusely transmitted through the surface. | No, default: `0`|
79
-
|**diffuseTransmissionTexture**|[`textureInfo`](/specification/2.0/README.md#reference-textureInfo)| A texture that defines the percentage of non-specularly reflected light that is diffusely transmitted through the surface. Stored in the alpha (`A`) channel. Will be multiplied by the diffuseTransmissionFactor. | No |
80
-
|**diffuseTransmissionColorFactor**|`number[3]`| The color that modulates the transmitted light. | No, default: `[1, 1, 1]`|
81
-
|**diffuseTransmissionColorTexture**|[`textureInfo`](/specification/2.0/README.md#reference-textureInfo)| A texture that defines the color that modulates the diffusely transmitted light, stored in the `RGB` channels and encoded in sRGB. This texture will be multiplied by diffuseTransmissionColorFactor.| No |
|**diffuseTransmissionFactor**|`number`| The percentage of non-specularly reflected light that is diffusely transmitted through the surface. | No, default: `0`|
78
+
|**diffuseTransmissionTexture**|[`textureInfo`](/specification/2.0/README.md#reference-textureInfo)| A texture that defines the percentage of non-specularly reflected light that is diffusely transmitted through the surface. Stored in the alpha (`A`) channel. Will be multiplied by the `diffuseTransmissionFactor` value.| No |
79
+
|**diffuseTransmissionColorFactor**|`number[3]`| The color that modulates the transmitted light. | No, default: `[1, 1, 1]`|
80
+
|**diffuseTransmissionColorTexture**|[`textureInfo`](/specification/2.0/README.md#reference-textureInfo)| A texture that defines the color that modulates the diffusely transmitted light, stored in the `RGB` channels and encoded in sRGB. This texture will be multiplied by the `diffuseTransmissionColorFactor` value. | No |
82
81
83
-
### diffuseTransmissionFactor
82
+
### Diffuse Transmission
84
83
85
84
The proportion of light that is diffusely transmitted through a surface, rather than being diffusely re-emitted. This is expressed as a percentage of the light that penetrates the surface (i.e., not specularly reflected), rather than a percentage of the total light incident on the surface. A value of 1.0 indicates that 100% of the light that penetrates the surface is transmitted through it.
86
85
@@ -106,9 +105,26 @@ The proportion of light that is diffusely transmitted through a surface, rather
106
105
</tr>
107
106
</table>
108
107
109
-
### diffuseTransmissionColorFactor
108
+
When textured, this parameter is sampled from the `A` channel of the `diffuseTransmissionTexture`. The value is linear and is multiplied by the `diffuseTransmissionFactor` to determine the total diffuse transmission value.
<em>Backlit, occluded plane with blue <code>baseColorFactor</code> and a striped <code>diffuseTransmissionTexture</code>.<br>(Input texture shown in the top-left).</em>
121
+
</td>
122
+
</tr>
123
+
</table>
124
+
125
+
### Diffuse Transmission Color
110
126
111
-
The proportion of light at each color channel that is not attenuated by the surface transmission. Attenuation is usually defined as an amount of light at each frequency that is reduced over a given distance through a medium by absorption and scattering interactions. However, since this extension deals exclusively with infinitely thin surfaces, attenuation is constant and equal to 1.0 - `diffuseTransmissionColorFactor`.
127
+
The proportion of light at each color channel that is not attenuated by the surface transmission. Attenuation is usually defined as an amount of light at each frequency that is reduced over a given distance through a medium by absorption and scattering interactions. However, since this extension deals exclusively with infinitely thin surfaces, attenuation is constant and equal to 1.0 - `diffuseTransmissionColor`.
112
128
113
129
<table>
114
130
<tr>
@@ -132,32 +148,8 @@ The proportion of light at each color channel that is not attenuated by the surf
132
148
</tr>
133
149
</table>
134
150
135
-
### diffuseTransmissionTexture
136
-
137
-
The `A` channel of this texture defines proportion of light that is diffusely transmitted through a surface, rather than being diffusely re-emitted. This is expressed as a percentage of the light that penetrates the surface (i.e., not specularly reflected), rather than a percentage of the total light incident on the surface. A value of 1.0 indicates that 100% of the light that penetrates the surface is transmitted through it.
138
-
139
-
The value is linear and is multiplied by the `diffuseTransmissionFactor` to determine the total diffuse transmission value.
151
+
When textured, the `RGB` channels of the `diffuseTransmissionColorTexture`, encoded in sRGB, define the proportion of light at each color channel that is not attenuated by the surface transmission. The values are multiplied by the `diffuseTransmissionFactor` to determine the final diffuse transmission color.
<em>Backlit, occluded plane with blue <code>baseColorFactor</code> and a striped <code>diffuseTransmissionTexture</code>.<br>(Input texture shown in the top-left).</em>
152
-
</td>
153
-
</tr>
154
-
</table>
155
-
156
-
157
-
### diffuseTransmissionColorTexture
158
-
159
-
The `RGB` channels of this texture define the proportion of light at each color channel that is not attenuated by the surface transmission.
160
-
The values are multiplied by the `diffuseTransmissionColorFactor` to determine the total diffuse transmission color.
This extension changes the `dielectric_brdf` defined in [Appendix B](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#material-structure)
188
+
196
189
```
197
190
dielectric_brdf =
198
191
fresnel_mix(
@@ -201,7 +194,9 @@ dielectric_brdf =
201
194
layer = specular_brdf(α = roughness ^ 2)
202
195
)
203
196
```
204
-
to the following:
197
+
198
+
to the following:
199
+
205
200
```
206
201
dielectric_brdf =
207
202
fresnel_mix(
@@ -213,12 +208,15 @@ dielectric_brdf =
213
208
layer = specular_brdf(α = roughness ^ 2)
214
209
)
215
210
```
216
-
Increasing the strength of the diffuse transmission effect using the `diffuseTransmissionFactor` parameter takes away energy from the diffuse reflection BSDF and passes it to the diffuse transmission BSDF. The specular reflection BSDF and Fresnel weighting are not affected.
211
+
212
+
Increasing the strength of the diffuse transmission effect using the `diffuseTransmission` parameter takes away energy from the diffuse reflection BSDF and passes it to the diffuse transmission BSDF. The specular reflection BSDF and Fresnel weighting are not affected.
217
213
218
214
## Implementation
215
+
219
216
*This section is non-normative.*
220
217
221
218
With a simple Lambert BRDF model, `diffuse_brdf` and `diffuse_btdf` may be implemented as follows
219
+
222
220
```
223
221
function diffuse_brdf(color) {
224
222
if (view and light on same hemisphere) {
@@ -258,23 +256,27 @@ function mix(bsdf0, bsdf1, factor) {
258
256
</div>
259
257
260
258
## Combining Diffuse Transmission with other Extensions
259
+
261
260
### KHR_materials_transmission
261
+
262
262
Both `KHR_materials_diffuse_transmission` and `KHR_materials_transmission` replace the diffuse BRDF with a mix of diffuse BRDF and a BTDF that transmits light onto the opposite side of the surface. In case of `KHR_materials_transmission`, this is a microfacet BTDF that shares its roughness with the microfacet BRDF. In case of `KHR_materials_diffuse_transmission`, on the other hand, this is a diffuse BTDF.
263
263
264
264
Let's recall the `dielectric_brdf` for `KHR_materials_diffuse_transmission` as defined above
265
+
265
266
```
266
267
dielectric_brdf =
267
268
fresnel_mix(
268
269
ior = 1.5,
269
270
base = mix(
270
271
diffuse_brdf(color = baseColor),
271
272
diffuse_btdf(color = diffuseTransmissionColor),
272
-
diffuseTransmission,
273
+
diffuseTransmission),
273
274
layer = specular_brdf(α = roughness ^ 2)
274
275
)
275
276
```
276
277
277
278
and compare it to the `dielectric_brdf` defined in `KHR_materials_transmission`
279
+
278
280
```
279
281
dielectric_brdf =
280
282
fresnel_mix(
@@ -336,6 +338,7 @@ Since the diffuse BTDF does not have controls for roughness, the roughness param
336
338
If `KHR_materials_transmission` is used in combination with `KHR_materials_diffuse_transmission`, the transmission effect overrides the diffuse transmission effect.
337
339
338
340
We can formalize this behavior by combining the two cases from above
When `KHR_materials_diffuse_transmission` is combined with `KHR_materials_volume`, a diffuse transmission BTDF describes the transmission of light through the volume boundary. The object becomes translucent. The light transport inside the volume is solely handled by `KHR_materials_volume` and is not affected by the surface BSDF.
382
387
383
388
<table>
@@ -421,14 +426,13 @@ When `KHR_materials_diffuse_transmission` is combined with `KHR_materials_volume
Copy file name to clipboardExpand all lines: extensions/2.0/Khronos/KHR_materials_diffuse_transmission/schema/material.KHR_materials_diffuse_transmission.schema.json
"description": "A texture that defines the percentage of light transmitted through the surface.",
19
-
"gltf_detailedDescription": "A texture that defines the strength of the diffuse transmission effect, stored in the alpha (A) channel. Will be multiplied by the diffuseTransmissionFactor."
19
+
"gltf_detailedDescription": "A texture that defines the strength of the diffuse transmission effect, stored in the alpha (A) channel. Will be multiplied by the `diffuseTransmissionFactor` value."
20
20
},
21
21
"diffuseTransmissionColorFactor": {
22
22
"type": "array",
23
23
"items": {
24
24
"type": "number",
25
-
"minimum": 0.0
25
+
"minimum": 0.0,
26
+
"maximum": 1.0
26
27
},
27
28
"description": "The color of the transmitted light.",
28
29
"default": [ 1.0, 1.0, 1.0 ],
29
30
"minItems": 3,
30
31
"maxItems": 3,
31
32
"gltf_detailedDescription": "The color of the transmitted light."
"description": "A texture that defines the color of the transmitted light",
36
-
"gltf_detailedDescription": "A texture that defines the color of the transmitted light, stored in the RGB channels and encoded in sRGB. This texture will be multiplied by diffuseTransmissionColorFactor."
"description": "A texture that defines the color of the transmitted light",
37
+
"gltf_detailedDescription": "A texture that defines the color of the transmitted light, stored in the RGB channels and encoded in sRGB. This texture will be multiplied by the `diffuseTransmissionColorFactor` value."
0 commit comments