Skip to content

Commit 708a654

Browse files
darksylinciche033
andauthored
Fix crash when hovering the cursor in heightmap.sdf (#536)
Hovering the cursor while in the ign gui when heightmap.sdf is opened would cause a shader compiler error. The triggering condition was having a directional light without shadow nodes. This error is from upstream OGRECave/ogre-next@e40bc53 Signed-off-by: Matias N. Goldberg <[email protected]> Co-authored-by: Ian Chen <[email protected]>
1 parent 73b9fa1 commit 708a654

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

ogre2/src/media/Hlms/Terra/GLSL/PbsTerraShadows/PbsTerraShadows_piece_vs_piece_ps.glsl

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
outVs.terrainShadow = mix( terraShadowData.x, 1.0, clamp( terraHeightWeight, 0.0, 1.0 ) );
3535
@end
3636

37-
@property( hlms_lights_directional )
37+
@property( hlms_lights_directional && hlms_num_shadow_map_lights )
3838
@piece( custom_ps_preLights )fShadow *= inPs.terrainShadow;@end
3939
@else
4040
@piece( custom_ps_preLights )float fShadow = inPs.terrainShadow;@end

ogre2/src/media/Hlms/Terra/HLSL/PbsTerraShadows/PbsTerraShadows_piece_vs_piece_ps.hlsl

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
outVs.terrainShadow = lerp( terraShadowData.x, 1.0, saturate( terraHeightWeight ) );
3737
@end
3838

39-
@property( hlms_lights_directional )
39+
@property( hlms_lights_directional && hlms_num_shadow_map_lights )
4040
@piece( custom_ps_preLights )fShadow *= inPs.terrainShadow;@end
4141
@else
4242
@piece( custom_ps_preLights )float fShadow = inPs.terrainShadow;@end

ogre2/src/media/Hlms/Terra/Metal/PbsTerraShadows/PbsTerraShadows_piece_vs_piece_ps.metal

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
outVs.terrainShadow = lerp( terraShadowData.x, 1.0, saturate( terraHeightWeight ) );
3737
@end
3838

39-
@property( hlms_lights_directional )
39+
@property( hlms_lights_directional && hlms_num_shadow_map_lights )
4040
@piece( custom_ps_preLights )fShadow *= inPs.terrainShadow;@end
4141
@else
4242
@piece( custom_ps_preLights )float fShadow = inPs.terrainShadow;@end

0 commit comments

Comments
 (0)