Skip to content

Commit

Permalink
Use the last entry of the lod config to cull meshes instead of the on…
Browse files Browse the repository at this point in the history
…e next to the last LOD.
  • Loading branch information
TothBenoit committed Dec 19, 2024
1 parent 2ca5608 commit badda91
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion h3d/prim/HMDModel.hx
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,12 @@ class HMDModel extends MeshPrimitive {

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

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

0 comments on commit badda91

Please sign in to comment.