Projection Mat Improvements
Robadob opened this issue · 3 comments
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.
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.
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.
Just checked and the demo linked from OP now works for me in Chrome.