-
Notifications
You must be signed in to change notification settings - Fork 352
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
Improvements to prefiltered environment maps #1420
Improvements to prefiltered environment maps #1420
Conversation
|
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.
This looks like an excellent proposal, @ApoorvaJ, and my main recommendation would be to leverage existing GLSL helper functions where possible, so that we don't end up with multiple implementations to optimize and maintain going forward.
As one example, I see this new implementation of height-correlated GGX/Smith masking shadowing:
https://github.com/AcademySoftwareFoundation/MaterialX/pull/1420/files#diff-eb403937b2a487a7fdf5a66ef7476114dd764cebd1cf209cebc77b5f59f1f4f8R88
And if it's possible to leverage (or extend) our existing implementation, that would be better:
https://github.com/AcademySoftwareFoundation/MaterialX/blob/main/libraries/pbrlib/genglsl/lib/mx_microfacet_specular.glsl#L99
Similarly, I see this new implementation of GGX NDF sampling:
https://github.com/AcademySoftwareFoundation/MaterialX/pull/1420/files#diff-eb403937b2a487a7fdf5a66ef7476114dd764cebd1cf209cebc77b5f59f1f4f8R54
And ideally we'd want to leverage (or extend) the existing GGX VNDF sampling that is used elsewhere in the MaterialX GLSL codebase:
https://github.com/AcademySoftwareFoundation/MaterialX/blob/main/libraries/pbrlib/genglsl/lib/mx_microfacet_specular.glsl#L65
In the latter example, we might see improved performance and convergence as well, if the existing VNDF sampling function can be used, but let me know if I'm missing any key differences in the new use case that would require a second helper method.
…eing non-pre-convolved.
Remove function call in OpenGL
This changelist reduces the environment sample count from 1024 to 256, taking advantage of the recently-added filtering.
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.
Thanks for this great work, @ApoorvaJ, and I believe this is now ready to merge. My own recent changes have been focused on aligning the GGX importance sampling with our existing approach in MaterialX, using the VNDF distribution and filtered samples.
3580bb7
into
AcademySoftwareFoundation:main
This changelist adds support for prefiltering environment maps on the GPU, using filtered VNDF sampling for efficiency. The MaterialX Viewer can be used to test the new functionality by unchecking the Environment FIS option in Advanced Settings.
As discussed with @jstone-lucasfilm, MaterialXView's pre-integrated IBL path (i.e. when FIS is turned off) is broken. This PR attempts to fix this issue.
Highlights of this PR
Source: Moving Frostbite to PBR (PDF)
Request for review
I'd like to specifically request review of the following:
get_smith_joint_ggx_part_lambda_v()
might be able to be formulated using existing code.