소스 검색

DepthAwareUpsampling : Use view position instead of world

TothBenoit 1 년 전
부모
커밋
c37de80eab
1개의 변경된 파일2개의 추가작업 그리고 5개의 파일을 삭제
  1. 2 5
      h3d/shader/DepthAwareUpsampling.hx

+ 2 - 5
h3d/shader/DepthAwareUpsampling.hx

@@ -3,10 +3,7 @@ package h3d.shader;
 class DepthAwareUpsampling extends ScreenShader {
 class DepthAwareUpsampling extends ScreenShader {
 	static var SRC = {
 	static var SRC = {
 
 
-		@global var camera : {
-			var inverseViewProj : Mat4;
-		}
-
+        @param var inverseProj : Mat4;
 		@param var source : Sampler2D;
 		@param var source : Sampler2D;
 		@param var sourceDepth : Sampler2D;
 		@param var sourceDepth : Sampler2D;
 		@param var destDepth : Sampler2D;
 		@param var destDepth : Sampler2D;
@@ -14,7 +11,7 @@ class DepthAwareUpsampling extends ScreenShader {
 
 
 		function getPosition( uv : Vec2, depthTexture : Sampler2D ) : Vec3 {
 		function getPosition( uv : Vec2, depthTexture : Sampler2D ) : Vec3 {
 			var depth = unpack(depthTexture.get(uv));
 			var depth = unpack(depthTexture.get(uv));
-			var temp = vec4(uvToScreen(uv), depth, 1) * camera.inverseViewProj;
+			var temp = vec4(uvToScreen(uv), depth, 1) * inverseProj;
 			var originWS = temp.xyz / temp.w;
 			var originWS = temp.xyz / temp.w;
 			return originWS;
 			return originWS;
 		}
 		}