Browse Source

Fix GPU culling with screen ratio.

clementlandrin 2 months ago
parent
commit
60bee44049
1 changed files with 1 additions and 1 deletions
  1. 1 1
      h3d/shader/InstanceIndirect.hx

+ 1 - 1
h3d/shader/InstanceIndirect.hx

@@ -76,7 +76,7 @@ class InstanceIndirectBase extends hxsl.Shader {
 		}
 		}
 
 
 		function getMinScreenRatio() : Float {
 		function getMinScreenRatio() : Float {
-			return ENABLE_LOD ? matInfos[0].w : 0.0;
+			return ENABLE_LOD ? matInfos[matID].w : 0.0;
 		}
 		}
 
 
 		function computeScreenRatio( distToCam : Float, radius : Float ) : Float {
 		function computeScreenRatio( distToCam : Float, radius : Float ) : Float {