Skip to content

Commit 946b3ea

Browse files
authored
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 : #1458 This PR should fix the issue.
1 parent d233f1d commit 946b3ea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ void main(){
8888
#endif
8989

9090
#ifdef USE_FOG
91-
fogDistance = distance(g_CameraPosition, (g_WorldMatrix * modelSpacePos).xyz);
91+
fogDistance = distance(g_CameraPosition, (TransformWorld(modelSpacePos)).xyz);
9292
#endif
9393

9494
}

0 commit comments

Comments
 (0)