소스 검색

Move depth range in NDC space to 0..1

Popov72 5 년 전
부모
커밋
3c6bb67ac4
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/Engines/WebGPU/webgpuShaderProcessors.ts

+ 1 - 1
src/Engines/WebGPU/webgpuShaderProcessors.ts

@@ -233,7 +233,7 @@ export class WebGPUShaderProcessor implements IShaderProcessor {
         if (!isFragment) {
             const lastClosingCurly = code.lastIndexOf("}");
             code = code.substring(0, lastClosingCurly);
-            code += "gl_Position.y *= -1.; }";
+            code += "gl_Position.y *= -1.;\ngl_Position.z = (gl_Position.z + gl_Position.w) / 2.0; }";
         }
 
         let sci = new ShaderCodeInliner(code);