浏览代码

Fix exception when using Instancing with Fog in PBR

The fog code in PBRLighting.j3md is encountering the same issue that was reported before with Lighting.j3md : https://github.com/jMonkeyEngine/jmonkeyengine/pull/1458

This PR should fix the issue.
Ryan McDonough 6 月之前
父节点
当前提交
946b3ea6c0
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      jme3-core/src/main/resources/Common/MatDefs/Light/PBRLighting.vert

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

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