浏览代码

Merge pull request #1705 from zhutq/master

Fixes fog for right-handed system
David Catuhe 8 年之前
父节点
当前提交
d02026fa10
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      src/Shaders/ShadersInclude/fogVertex.fx
  2. 1 1
      src/Shaders/sprites.vertex.fx

+ 1 - 1
src/Shaders/ShadersInclude/fogVertex.fx

@@ -1,3 +1,3 @@
 #ifdef FOG
 #ifdef FOG
-fFogDistance = (view * worldPos).z;
+fFogDistance = abs((view * worldPos).z);
 #endif
 #endif

+ 1 - 1
src/Shaders/sprites.vertex.fx

@@ -46,6 +46,6 @@ void main(void) {
 
 
 	// Fog
 	// Fog
 #ifdef FOG
 #ifdef FOG
-	fFogDistance = viewPos.z;
+	fFogDistance = abs(viewPos.z);
 #endif
 #endif
 }
 }