-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KHR_materials_diffuse_transmission #1825
base: main
Are you sure you want to change the base?
KHR_materials_diffuse_transmission #1825
Conversation
/ping @abwood New diagram added, looks nice! |
BTW, This extension is not yet listed in the list of glTF extensions. |
- Move info in interaction with other extensions to translucency - Add images - Add more detailed explanation
…one.3ds.com:7999/~o3v/gltf into KHR_materials_translucency
e5e96b4
to
6d8e1f2
Compare
extensions/2.0/Khronos/KHR_materials_diffuse_transmission/README.md
Outdated
Show resolved
Hide resolved
Created (path-tracing) live demos for the example scenarios. |
...HR_materials_diffuse_transmission/schema/glTF.KHR_materials_diffuse_transmission.schema.json
Outdated
Show resolved
Hide resolved
@echadwick-wayfair fixed it, thanks! |
Any updates on the progress on this extension? I'm looking at releasing a new version of gltfpack in the next month or so and unsure if it should include support for this extension even though it's still not merged to avoid a situation where it gets released shortly afterwards and isn't supported for some period of time, or if this extension is still in a significant state of flux and won't get merged any time soon. |
@zeux That's a great question. I would like to see this extension ratified mostly as-is, but it may not happen soon. I've re-started the discussions on the Khronos PBR TSG calls, but I can't guarantee it will suddenly move forward. There are an assortment of concerns ranging from performance to interoperability to consistency between engines. If you know of some solid use cases or sample models that we could use as fuel for the burning desire for this, please let me know. |
there is a sample model? |
I have added three sample assets so far (thanks to @bsdorra for pathtraced versions of the plant and teacup) https://github.com/KhronosGroup/glTF-Sample-Assets/tree/main/Models/DiffuseTransmissionTeacup https://github.com/KhronosGroup/glTF-Sample-Assets/tree/main/Models/MandarinOrange (this should be done with SSS instead, not a thin-walled surface shape, but it does demonstrate some odd backscatter behavior) |
We probably need a sample asset grid of flat shapes to stress test combinations of values. Which of these should be represented?
I can manufacture a test asset, if I have a set of parameters we’d like to include. |
extensions/2.0/Khronos/KHR_materials_diffuse_transmission/README.md
Outdated
Show resolved
Hide resolved
extensions/2.0/Khronos/KHR_materials_diffuse_transmission/README.md
Outdated
Show resolved
Hide resolved
extensions/2.0/Khronos/KHR_materials_diffuse_transmission/README.md
Outdated
Show resolved
Hide resolved
extensions/2.0/Khronos/KHR_materials_diffuse_transmission/README.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I should open up a new PR with my proposed changes in order to get progress on this extension?
|
||
## Overview | ||
|
||
This extension adds a Lambertian diffuse transmission BSDF to the metallic-roughness material. Thin, dielectric objects like leaves or paper diffusely transmit incoming light to the opposite side of the surface. For optically thick media (volumes) with short scattering distances and therefore dense scattering behavior, a diffuse transmission lobe is a phenomenological plausible and cheap approximation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A more physically based wording would be along the lines of:
This extension models the physical phenomenon of light being transmitted into a material, this light is attenuated and re-emitted on the opposite side. This is called attenuated light. Attenuation occurs immediately as light enters into the surface, there is no attenuation distance (Beer-Lambert Law). The amount of attenuated light is controlled by the transmissionFactor, this specifies the percentage of non-reflected light that is transmitted into the material. A higher value means that more of the non-reflected (diffuse) light from the opposite side will be re-emitted, a lower value means less light will be re-emitted. Color of the attenuated light is specified by attenuationColor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other extensions suggest that the overview part focuses more on the practical application of the extension than the underlying physical concepts. Property descriptions seem to be a more appropriate location. Let me try to reword and add sections based on your suggestion (and also following the example of KHR_materials_transmission).
Overview
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 objects surface boundaries. In 3D graphics, it is common to approximate thin volumetric objects as non-volumetric surfaces.
KHR_materials_diffuse_transmission
models the diffuse transmission of light through such infinitely thin surfaces. For optically thick media (volumes) with short scattering distances and dense scattering behavior, KHR_materials_diffuse_transmission
provides a phenomenologically plausible and cost-effective approximation.
.
.
.
Properties
diffuseTransmissionFactor
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.
diffuseTransmissionColorFactor
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
.
diffuseTransmissionTexture
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.
The value is linear and is multiplied by the diffuseTransmissionFactor
to determine the total diffuse transmission value.
diffuseTransmission = diffuseTransmissionFactor * diffuseTransmissionTexture.a
diffuseTransmissionColorTexture
The RGB
channels of this texture define the proportion of light at each color channel that is not attenuated by the surface transmission.
The values are multiplied by the diffuseTransmissionColorFactor
to determine the total diffuse transmission color.
diffuseTransmissionColor = diffuseTransmissionColorFactor * diffuseTransmissionColorTexture.rgb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my opinion the overview must clearly outline the goal of the extension.
In the case of a material property extension like this, it makes perfect sense to describe the physical behavior or phenomena that is modelled.
The property description then specifies each parameter.
extensions/2.0/Khronos/KHR_materials_diffuse_transmission/README.md
Outdated
Show resolved
Hide resolved
There are a couple of design issues with this extension, let me explain: 1: This extension models the scattering behavior of dense, non fully opaque, materials such as leaves or wax. 2: This extension is more or less based on an adaptation of the Beer/Lambert law. These two phenomena shall not be mixed into the same extensions - I know that it is super easy to get a shader to execute the code - it's just not a good parameterization of needed data. Luckily there is a simple solution: Make this extension into 'scattering transmission'
Now we have a self contained simplified extension, with less number of parameters, where the parameters are connected to what they actually control. Surely we must strive to have self contained, well parameterized extensions - we must not keep using the rationale 'we did it like this in extension XYZ' |
No, that's not a complete understanding. This extension only models what happens at the outermost surface of a material, such as the outermost surface of a block of wax, or on a thin-wall material such as a leaf. It allows light to enter and exit a volume such as wax, but it cannot say anything about what happens to light whilst travelling inside the volume. The presence of the volume and the properties within are governed by a different extension.
That's not quite correct. KHR_materials_transmission is a surface property, allowing light to enter and exit at the surface of a volume of material such as glass or water, possibly with a tint on the way in and out. The KHR_materials_volume extension intentionally doesn't explain how light got into or exits from the volume, it just explains the thickness of the volume and how light is attenuated along the way. The two are compatible, but KHR_materials_volume was always intended to be compatible with additional methods of entry and exit. For some graphical depictions of what I've said here, take a look at the slides of my 2022 webinar on glTF PBR here: Slide 14 covers this extension, and several slides before that explain the volumetric extension. Slide 16 has the chart that puts together compatibility and interactions between our various PBR extensions. I'd really encourage folks to read and deeply understand how this is intended to work before posting lengthy comments requesting foundational changes.
No, that's incorrect. This draft does not mention Beer's law, as this draft is only for the outermost surface of a material. Beer's law is covered by KHR_materials_volume with attenuation color and attenuation distance. See slide 16 of the above for an overview of how this all fits together. The overall design here wasn't just invented by me, of course. Bastien and Tobias authored many of these drafts based closely on Dassault Systemes Enterprise PBR, which is a published standard with active users. They got feedback in PBR TSG from Adobe, Autodesk, Microsoft / BabylonJS, Google / Filament / ThreeJS, and other PBR experts along the way. A lot of care and respect was given to fundamental PBR concepts such as energy conservation during those many discussions. Please take time to understand what's here, as a lot of thought and care went into it, and similar properties are already in use by other published standards. |
- Add more detailed parameter descriptions based on PR feedback + renderings - Add dragon and candle renderings as example for diffuse transmission + volume - Remove example section
Should this extension be targetable by animation pointer? |
@UX3D-haertl I'll update the object model after this is merged. |
Confusion likely comes from specifying (physically plausible) behavior using (only) surface properties and the concept of 'thin walled' or infinetly thin materials, which I generally regard as unwise. For this extension I think we must focus on usecases, leaf and wax candle, and figure out what we need to model this behavior. I strongly believe in simplification - less is more - use of two extensions instead of one will increase complexity. From what I can tell our usecases can be fulfilled by adding two optional parameters: What, if any, is the benefit of splitting and declaring surface properties and interior/scattering behavior into separate extensions? |
extensions/2.0/Khronos/KHR_materials_diffuse_transmission/README.md
Outdated
Show resolved
Hide resolved
extensions/2.0/Khronos/KHR_materials_diffuse_transmission/README.md
Outdated
Show resolved
Hide resolved
extensions/2.0/Khronos/KHR_materials_diffuse_transmission/README.md
Outdated
Show resolved
Hide resolved
<figcaption> | ||
<em>Left: (Thin) translucent leaves/foliage, Right: (Thick) translucent candle with colored volume attenuation and translucent surface. | ||
</em><br> | ||
<p style="font-size:0.7em;">(candle model by <a href="https://sketchfab.com/lucatorcigliani">lucatorcigliani</a> with modifications by @emackey. Original <a href="https://sketchfab.com/3d-models/candle-in-a-glass-ec6cf358c4dd4cbda7be67f7846cbc9e">source</a> CC-BY 4.0)<p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaves image credit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The scene was modeled by a colleague but origin of textures is not clear. We may need to replace the image.
An extension for the metallic-roughness material that adds a translucency effect, i.e., a diffuse lobe on the back-side of the surface. This is useful
KHR_materials_volume
(KHR_materials_volume #1726) in case of SSS with short scattering distance