-
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
OIT aliasing fixes #12916
OIT aliasing fixes #12916
Conversation
CraigFeldspar
commented
Aug 30, 2022
- Implemented multisampling for DepthPeeling (works but has artifacts along triangle edges because we need to access multisampled depth in the shader, which cannot be done for now)
- Made depth peeling compatible with post processes to be able to use FXAA post process
Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). |
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.
Great job!
What about WebGPU: does it work there too? If not and you are not able to fix it, you should create an issue for me so that I can have a look when I come back.
[EDIT] It probably won't work because in WebGPU textures are recreated when the sample count is updated and it's not possible to simply update a texture with the new value, the texture must be recreated. That means you will need to update the loop below so that the sample count is not updated multiple times for the same texture:
for (let i = 0; i < 2; i++) {
this._depthMrts[i].samples = value;
this._colorMrts[i].samples = value;
}
Is it a limitation of WebGL or Babylon.js? If the latter, maybe we can have a look and see how to add the support (@sebavan)? |
@CraigFeldspar, any news on this PR ? |
Hey Seb, looking at it shortly |
So, this PR has 2 parts :
But after the fact, I realized that MSAA has absolutely no value in our case since in WebGL2, Therefore we will always read and write 1 depth per pixel in the depth layers, so we got no value from multisampling. But since I already spent time on it, and it still works, even if it's unusable, I figured out it's better to leave it there until the time we can really fetch these multiple samples. That's also why I added the comment that MSAA requires RGBA, so we can be reminded if we pick back up the implementation. I will hide the |
I think that given my above comment, we should anyway leave the multisample as it is, and pick it back if/when WebGL or WebGPU allows for multisampled |
@sebavan ready for round 2 :) |
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://babylonsnapshots.z22.web.core.windows.net/refs/pull/12916/merge/index.html#WGZLGJ#4600 Links to test babylon tools with this snapshot: https://playground.babylonjs.com/?snapshot=refs/pull/12916/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/12916/merge#BCU1XR#0 |
It's fine to me, let's just comment out the getter and setter and we are good to go. |
done ! |
OIT aliasing fixes Former-commit-id: 694e91c752f2b23075061383d53f32a44a8a85b2