-
Notifications
You must be signed in to change notification settings - Fork 353
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
Examine transparency handling for hardware code generation #859
Comments
Based on specification discussion, the h/w logic should be updated to follow this heuristic:
which can be added to the Adding a ping to @JGamache-autodesk for follow-up from previous discussion. |
I like this. Can I dream about a hint named "isotropic" that would select between isotropic and anisotropic versions of dielectric/conductor/schlick nodes when roughness.x is detected to be equal to roughness.y? This would allow standard_surface to run without a tangent stream most of the time. |
Think dreams should be sent to @dbsmythe -- and best to raise this as a new "tangential" issue :) The point about optimization based on "hint" is interesting but is counter to shader reuse as any value change means So I would leave here an additional thought about adding an implementation level hint if a "value" change is a shader graph "topology" change. |
Really good point! I am not currently integrating the isTransparent result into the shader hash used in the MayaUSD topologically-equivalent shader cache, which means a scene with a mix of transparent and opaque shaders is currently broken. Will open an issue. |
Regarding @JGamache-autodesk 's thought about adding a hint for anisotropy, this is an interesting idea which I think the hint system might be able to accommodate, though not quite in the same way as transparency/opacity. For transparency/opacity, the hint is placed on the to say that this input actually indicates the level of transparency or opacity, as the interpretation of those inputs is (I think) pretty universal and uncontroversial. For anisotropy, I think we could add a hint on whatever input is used to set the bitangent-direction roughness, but the hint's presence would merely indicate that there is a possibility for anisotropic reflections to occur, not necessarily that they are: this is because the input could either be specifying actual bitangential roughness, or it could be an anisotropic eccentricity amount depending on the implementation, and there isn't a standard interpretation of this value that I'm aware of. But since the primary purpose of this hint would be simply to indicate whether or not separate tangent/bitangent streams must be maintained, I think we can leave the interpretation of the hint as basically just a boolean "there might be anisotropy here". Not a perfect "there is anisotropy", but better than nothing. And note that the polarity of the hint must be "anisotropic" and not "isotropic" at least on nodes with two roughness-like inputs, as I don't think you could give a hint of "isotropic" and know that there couldn't possibly be anisotropy: since the hint lives in the nodedef, it can't be added only in certain situations known to be isotropic. For shader nodes with only a single roughness value, the absence of an "anisotropic" hint would be sufficient to indicate no anisotropy can occur. One possible downside of this is that if an implementation now depends on the presence of this (new) hint to enable anisotropic reflections, then any legacy nodes without the hint in their nodedef would suddenly break. |
This issue has been logged for discussion purposes
Background
Proposed Items To Examine:
transmission
is not included in the final color computation and instead relies on h/w alpha blending which is a "cheap" way to draw transparent objects. This should be re-examined as this may not be a given.transmission_color
be checked for "unlit" shader.<implementation>
s as this has as it's main usage hardware rasterizers.Appendix:
Some examples of such as switch:
https://github.com/AcademySoftwareFoundation/MaterialX/blob/main/source/MaterialXGenGlsl/Nodes/SurfaceNodeGlsl.cpp#L201
https://github.com/AcademySoftwareFoundation/MaterialX/blob/main/source/MaterialXGenGlsl/GlslShaderGenerator.cpp#L643
An unlit surface shader constructor node. #860
The text was updated successfully, but these errors were encountered: