Skip to content

Commit

Permalink
Added check to see if lodConfig has a suitable culling entry.
Browse files Browse the repository at this point in the history
  • Loading branch information
TothBenoit committed Dec 19, 2024
1 parent badda91 commit 3dfdd6f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions h3d/prim/HMDModel.hx
Original file line number Diff line number Diff line change
Expand Up @@ -307,12 +307,12 @@ class HMDModel extends MeshPrimitive {

var lodConfig = getLodConfig();
if ( lodConfig != null ) {
// Culling
if ( screenRatio < lodConfig[lodConfig.length - 1] )
var lodConfigHasCulling = lodConfig.length > lodCount - 1;
if ( lodConfigHasCulling && screenRatio < lodConfig[lodConfig.length - 1] )
return lodCount;

var lodLevel : Int = 0;
var maxIter = ( ( lodConfig.length > lodCount - 1 ) ? lodCount - 1: lodConfig.length );
var maxIter = lodConfigHasCulling ? lodCount - 1 : lodConfig.length;
for ( i in 0...maxIter ) {
if ( lodConfig[i] == 0.0 )
return lodLevel;
Expand Down

0 comments on commit 3dfdd6f

Please sign in to comment.