projection work + tests

This commit is contained in:
Nick Fisher
2025-03-28 10:01:00 +08:00
parent e8169e86d1
commit cd1c2f3827
8 changed files with 687 additions and 39 deletions

View File

@@ -100,8 +100,8 @@ fragment {
//material.baseColor = vec4(sampledDepth.r, 0.0, 0.0, 1.0);
//material.baseColor = vec4(vertexDepth, 0.0, 0.0, 1.0);
if(materialParams.useDepth && abs(vertexDepth - sampledDepth.r) > 0.001) {
discard;
if(materialParams.useDepth && (sampledDepth.r < 0.0001 || abs(vertexDepth - sampledDepth.r) > 0.001)) {
material.baseColor = vec4(0.0, 0.0, 0.0, 0.0);
} else {
vec2 texSize = vec2(textureSize(materialParams_color, 0));
vec4 color = textureLod(materialParams_color, uvToRenderTargetUV(deviceCoords.xy), 0.0f);