Skip to content

Commit

Permalink
Added CPU culling if screen ratio gives out of bound LOD instead of p…
Browse files Browse the repository at this point in the history
…icking last LOD
  • Loading branch information
TothBenoit committed Dec 18, 2024
1 parent 057d027 commit 5e0db40
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion h3d/prim/HMDModel.hx
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ class HMDModel extends MeshPrimitive {

var materialCount = data.indexCounts.length;
var lodLevel = Std.int(curMaterial / data.indexCounts.length);
if ( lodLevel >= lodCount() )
return;

if( indexes == null || indexes.isDisposed() )
alloc(engine);
Expand Down Expand Up @@ -306,7 +308,7 @@ class HMDModel extends MeshPrimitive {
var lodConfig = getLodConfig();
if ( lodConfig != null ) {
var lodLevel : Int = 0;
var maxIter = ( ( lodConfig.length > lodCount - 1 ) ? lodCount - 1: lodConfig.length );
var maxIter = ( ( lodConfig.length > lodCount ) ? lodCount : lodConfig.length );
for ( i in 0...maxIter ) {
if ( lodConfig[i] == 0.0 )
return lodLevel;
Expand Down

0 comments on commit 5e0db40

Please sign in to comment.