浏览代码

Fix for lighting vertex shader when used with Fog and InstancedNode. All credit to sailsman63 for the actual fix. More info: https://hub.jmonkeyengine.org/t/shader-compile-error-with-instancednode-lighting-material-and-linearfog/44124/2

Duncan 4 年之前
父节点
当前提交
9f2640d851
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      jme3-core/src/main/resources/Common/MatDefs/Light/Lighting.vert

+ 1 - 1
jme3-core/src/main/resources/Common/MatDefs/Light/Lighting.vert

@@ -186,6 +186,6 @@ void main(){
     #endif
 
     #ifdef USE_FOG
-    fog_distance = distance(g_CameraPosition, (g_WorldMatrix * modelSpacePos).xyz);
+    fog_distance = distance(g_CameraPosition, (TransformWorld(modelSpacePos)).xyz);
     #endif
 }