-
Notifications
You must be signed in to change notification settings - Fork 3
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
glTF Boombox test model #1
Conversation
A couple of issues I ran into when creating the glTF node:
|
https://gpuopen.com/learn/amd-usd-hydra-blender/ appears to support MaterialX but there are some hitches. |
@proog128 These are great questions. And justified questions since they touch on areas in MaterialX that are still in the design phase or lacking on the implementation side. There a lot of things covered here but I will try to provide some answers. 1) Emission under coat Our current plan for this feature is to handle this through the vertical layering operator, adding a layer(BSDF, EDF) version that can define a BSDF layered over an EDF. The same method we use for "BSDF over BSDF" layering could then be used for "BSDF over EDF" layering, where the EDF is attenuated by the directional dependent albedo from the BSDF on top. Adding this new layer node version is in the proposal/design phase. 2) Thin-walled materials 3) Transmission in MaterialXView 4) Nested dielectrics The signatures for these closures are part of OSL now, you can find At this point we have settled for the signatures but no implementation is started on yet as far as I know. The plan is to implement all of the closures in OSL "testrender", to serve as a reference implementation of MaterialX PBS nodes. Of interest might also be the full discussions that lead up to these OSL closures, which was done in a PR on MaterialX side: AcademySoftwareFoundation#614 Note that some of the closures are slightly different from the MaterialX node counterparts. When/if the OSL implementation turns out to work well we will incorporate these design changes on MaterialX side. 5) Scale base layer with (1.0 – max(fr(f0.r, f0.g, f0.b)) For 6) Blending between plastic and glass An alternative we are considering, which also is part of the new OSL closure definitions, is to have tint controls over the two lobes instead of the scatter_mode enum with just on or off: 7) Reference ray tracer |
@niklasharrysson Thanks for the answers and sorry for the delay! 1) Emission under coat Looking forward to these features! 3) Transmission in MaterialXView Unfortunately, "Render Transparency" doesn't help. @bernardkwok wants to look into this issue in MaterialXView. 4) Nested dielectrics Thanks for the links, very interesting discussions! Is this 5) Scale base layer with (1.0 – max(fr(f0.r, f0.g, f0.b))
Oh, I see, that makes sense. The average avoids complementary colors. Does it also avoid energy gain in each color channel? If for example
the final color is computed by summing (per channel) 6) Blending between plastic and glass Separate tint for reflection and transmission is a step into the right direction (for glTF), but not enough when considering specular color. Specular tint in glTF is angle-dependent. For a single-channel weight
whereas the
if I understood it correctly. Any chances that MaterialX includes a function that is compatible to glTF? Otherwise we could go with |
3) Transmission in MaterialXView Great, I will sync up with Bernard on that. 4) Nested dielectrics Yes this is because of missing support in MaterialXView. Volumetrics in general is missing implementations in our GLSL codegen. The But to answer your question, when the
5) Scale base layer with (1.0 – max(fr(f0.r, f0.g, f0.b)) Yes your observation is correct. Since we use the average in this case there might be a problem with energy conservation in some cases. We have not seen that as a problem in practice yet, with a saturated/non-white tint for a dielectric it's a non-physical setup anyway. But using max of the components instead of average would be a better strategy to avoid this. Thanks for pointing that out. 6) Blending between plastic and glass Actually the But in terms of the fresnel effect you are right that with Also want to clarify the statement I made about using |
Thanks for the answers and for bringing the topics into the MaterialX repo. 4) Nested dielectrics and transmission color One thing I didn't understand yet is how the IOR ratio of nested volumes impacts
(As Is it possible to access the Another question: does the MDL backend support volumes already? Would it be possible to test volumes in #2 with the MDL code generator and Iray or the MDL-SDK DXR renderer? What is the workflow for generating MDL code? So far I used MaterialXView and pressed the |
Hi Tobias, I'll try to provide some more answers here: Could specular be passed as weight to generalized_schlick_bsdf? Yes you should be able to pass your Is it possible to access the outside_ior in the graph? There is no control of the "outside" IOR in the material description. The current IOR has to be tracked by the renderer when a new interface is entered. The initial outside IOR could for example be set as a global property for all outside media, or set and tracked from the camera origin, or assumed as IOR=1.0 for vacuum. But it's a renderer problem to track IOR, since the outside changes when entering a volume, and only the renderer has knowledge about how you arrived at a new interface. MDL and volumetric support? About volumetrics in general I've taken a closer look at where we stand now, and unfortunately I would have to say we are still too early in the implementation stages for this to be of practical use yet. For MDL we do have codegen support for the volume shader and the VDF nodes. But there is no good support to combine volumes with a surface shader in order to achieve what you want in #2 There is no The quickest path forward would probably be to implemented this layer operator for the MDL codegen, and then one could start experimenting with volumes inside surface shaders in practice. |
I should add that the BSDF-over-VDF layer operator is something we are working on as part of a larger task to improve our BSDF implementations. So hopefully we can have that working in MDL "soon". I'll ping again when we have something to test. |
MDL and volumetric support? OK, thanks for the clarification. I will be happy to test it once it's available! Is it possible to access the outside_ior in the graph? How does the The The background here is that the glTF BSDF by default (i.e., specular =1, specular color = 1, (transmitted_)ior = 1.5) should behave "physically-correct". On top of that, and only if required, specular and specular color can be used to optimize f0 for certain cases which are not handled by such a simplistic model (and thus require artistic tweaking), for example fabrics. But the effect of specular and specular color on f0 is always relative to what was computed from the IOR. Specular and specular color do not override the f0-from-IOR, it's a multiplication. |
MDL and volumetric support? Just a quick update that we have support for the BSDF-over-VDF layer operator now, so it should be possible to start experimenting with this in MDL, using an MDL renderer that supports volumetric rendering (e.g. Iray). This layer operator is implemented for GLSL and OSL as well, but for those targets we don't have the VDF itself yet. For GLSL Lucasfilm is working on this, and some other improvements to transmission, so hopefully we will have better transmission, with absorption, in MaterialXView as well soon. IOR and generalized_schlick_bsdf |
It sounds like this question is specifically about how to handle exterior IOR with |
@niklasharrysson That sounds great, I will try it out in the next days, thank you very much. @jstone-lucasfilm Yes, the question is about handling of exterior IOR and nested dielectrics in We need to compute f0 and f90 based on color inputs (called "specular color" and "specular" in glTF), interior IOR (called "ior" in glTF) and exterior IOR. Exterior IOR must be provided by the renderer. Do you mean an explicit |
@proog128 That's a good question to discuss, and this could either be an explicit Here's the ASWF Calendar with a Zoom link for the MaterialX TSC meeting: https://www.aswf.io/meeting-calendar/ And here are instructions for joining the MaterialX channel of the ASWF Slack, where our meeting agendas are organized, and proposals for new features can be brought up: |
Thanks for the invitation, looking forward to discussing this in the meeting. |
Transmission and volumes using the BSDF-over-layer operator works, thanks @niklasharrysson. I use the following structure:
A couple of images rendered in the dxr example from the MDL SDK (using MDL codegen): Rough Reflection and Transmission: Transmission and specular color: Thin walled (glTF volume thickness = 0) is still to be done. But I think this is a task for next year :-) |
@proog128 That's great news! Thanks for sharing the results. Sounds good to defer work on thin-walled materials to next year. We are revisiting the description of thin-walled and double sided materials in MaterialX. So work on that might be better to delay until the new description is in place. |
Hi @emackey, @jstone-lucasfilm, @proog128 I am running tests in a local fork first (kwokcb#14) and if that' passes will put up an ASWF PR. |
@kwokcb Sounds great! I can open a new PR for my BoomBox sample material, if you like. I guess I need to figure out how to sign the CLA? |
I've finished testing and added some small updates so that the default and boombox files get included as part of unit testing and CI. Results are in the PR. |
The ASWF PR is now up here: AcademySoftwareFoundation#870. |
Closing this draft. Further discussion in: AcademySoftwareFoundation#870 |
This draft PR serves as a place for discussion and testing of the work-in-progress glTF node for MaterialX.
Included here are:
libraries/bxdf/gltf_pbr.mtlx
- @proog128's first prototype of the glTF node for MaterialX.resources/Materials/Examples/glTFPBR/gltf_pbr_default.mtlx
- Sample usage of the glTF node.This branch also has a simple test model.
resources/Geometry/boombox.obj
. (This needs updating to load glTF directly!)resources/Materials/Examples/glTFPBR/gltf_pbr_boombox.mtlx
.The material in step 3 uses the prototype glTF node to display the boombox sample's material. It should look like this:
Known issues: