-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Separate CDF Renderer from IBL Shadows and use for realtime filtering #15878
Separate CDF Renderer from IBL Shadows and use for realtime filtering #15878
Conversation
8f33457
to
ea008bf
Compare
Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). |
If we can improve performance AND the quality of real-time filtering, I'm all for it! However, I think it should be a new path that we can enable/disable, because replacing what we currently have would be a breaking change, and I know that for the commerce sandbox, we should be sure that the new code doesn't break anything => or, at least, we should discuss this internally and decide if we can allow a breaking change here. I'm also wondering if we could pre-calculate the two CDF textures and integrate them into an .env file? I think we have a version number in the .env files, so it would be easy to support a new format, where these two textures would have been precalculated. This way, the new code path will be automatically selected at runtime when we load these .env files, and we won't have to suffer the generation time. cc @sebavan One thing about your PR: is it possible to undo all the formatting changes in the shader code? A lot of the changes only concern formatting (undoing them would simplify reviewing), and I also find the new formatting difficult to read, with types appearing on the next line... |
ea008bf
to
534693e
Compare
Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). |
Agreed. I've made it its own code path now. Set Yes, the CDF maps could absolutely be part of the .env file, along with irradiance. If the prefiltered maps are already created, however, the CDF maps aren't needed anymore except for other features like IBL shadowing. About the shader formatting, VSCode keeps doing that and I need to remember to disable "format on save" while working on shaders. Do you guys use different settings to avoid this? |
Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). |
I'm still having problems getting the WebGPU version to actually load the WGSL shaders. If I purposely type in bad code in |
0a7f97a
to
981b168
Compare
Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). |
2 similar comments
Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). |
Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). |
Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). |
Snapshot stored with reference name: Test environment: To test a playground add it to the URL, for example: https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/15878/merge/index.html#WGZLGJ#4600 Links to test babylon tools with this snapshot: https://playground.babylonjs.com/?snapshot=refs/pull/15878/merge To test the snapshot in the playground with a playground ID add it after the snapshot query string: https://playground.babylonjs.com/?snapshot=refs/pull/15878/merge#BCU1XR#0 |
Visualization tests for WebGPU (Experimental) |
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.
Fantastic work! Thanks a ton!
WebGL2 visualization test reporter: |
237ded8
to
8e58ce3
Compare
I'd like to improve the realtime filtering and prefiltering of IBL's using the CDF maps that I'm using for IBL shadows. To do this, I'm separating the CDF renderer out from the IBL Shadows Pipeline.
Then, as a first step, I'm using these maps to improve the realtime filtering of irradiance.
As a test, here's an extreme IBL with a single sunlight rendered in a raytracer.
Here's how it looks with spherical harmonics:
Here's the old real-time filtering:
And the new real-time filtering:
I still may not have the math quite right, especially for the weighting, but the early results are very promising. I haven't changed the number of samples yet but we should be able to lower them from what they currently are.
TODO:
irradiance()
function in the glsl shaders, it seems to affect the WebGPU rendering as well. I really don't understand why.