Converted rendering engine to reverse-z

This commit is contained in:
TriVoxel
2025-04-29 14:33:13 -06:00
parent 0cdb90bdb8
commit 5b5de92890
16 changed files with 151 additions and 124 deletions

View File

@ -34,8 +34,8 @@ vec2 rand2(const vec2 coord) {
}
float linearize(float depth, vec2 cameraProj) {
depth = depth * 2.0 - 1.0;
return cameraProj.y / (cameraProj.x - depth);
return cameraProj.y / (cameraProj.x - max(depth, 1e-6));
//return cameraProj.y / (cameraProj.x - depth);
}
float attenuate(const float dist) {