Explorar o código

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 hai 6 meses
pai
achega
946b3ea6c0

+ 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
 
 }