Closed yuyaolong closed 6 months ago
Admittedly, this could work, but I was concerned about the loss of precision due to the perspective divide. I did not want to have z-fighting like issues for splats that are far from the camera, that is why I elected to just use the "z" value of the splat (in camera space) as the sort key.
Firstly thank you for your reply. I still wonder why it's not "float depth = p.z;" from here: https://www.songho.ca/opengl/gl_projectionmatrix.html p.w will be a fixed number like -Ze
Maybe I miss some info here.
Thanks again
-Z_e is not fixed, it's the z coordinate of the splat position in camera space. (aka eye space)
https://github.com/hyperlogic/splatapult/blob/818ba0f2a743ee41f6a4f6c382a77570d27f1361/shader/presort_compute.glsl#L41