Skip to content
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

Projection Mat Improvements #61

Open
Robadob opened this issue Apr 22, 2021 · 3 comments
Open

Projection Mat Improvements #61

Robadob opened this issue Apr 22, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@Robadob
Copy link
Member

Robadob commented Apr 22, 2021

Could be worth switching to reverse depth + infinite far plane.

Reverse depth makes better use of how floating point numbers hold greater precision close to 0, reducing collisions.

Infinite far plane simplifies what a user may have to configure, with apparently little downsides (e.g. loss of precision).

Additionally, splitting the mvp matrices can also have an impact on compounding floating point errors. But that's upto the individual shaders, which we might officially provide users with the ability to change in future.

I've never tested these techniques, but they seem like a good idea and they're generally agreed upon from what I've been reading.

This seems like most useful guide: https://thxforthefish.com/posts/reverse_z/

Other discussion of the topic:
https://developer.nvidia.com/content/depth-precision-visualized
http://www.terathon.com/gdc07_lengyel.pdf

This is supposed to have a webgpu example, but currently requires chrome nightly so I haven't tested it.

http://austin-eng.com/webgpu-samples/samples/reversedZ

@Robadob Robadob added the enhancement New feature or request label Apr 22, 2021
@ptheywood
Copy link
Member

From the root page of the webgpu-samples site:

These samples run in Chrome Canary behind the flag "--enable-unsafe-webgpu".

I.e. they don't work in FF / regular chrome for me, and I don't have canary installed.

@Robadob
Copy link
Member Author

Robadob commented Apr 22, 2021

Ah well spotted.

I did follow the link to : http://webgpu.io/

Which says chrome supports, but The chrome://flags/#enable-unsafe-webgpu flag must be enabled.

Then found that flag doesn't exist in my chrome.

I suppose, I read the empty cell in that table as it being fine. Really needs a red cross.

Might be in main-line chrome by the time I get around to playing with this.

@Robadob
Copy link
Member Author

Robadob commented Dec 14, 2021

Just checked and the demo linked from OP now works for me in Chrome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants