How to scale terrain without breaking lod


first of all i have to say that the terrain-system already looks very good.

But i noticed in the example that if i scale the the terrain up, the lod system seems to break.

The terrain is almost everywhere rendered in the lowest lod value (except in the center of the terrain). o_O

For scaling i used the setLocalScale().

Is this a bug or is setLocalScale not the right method to scale it?


Hmm, maybe I have encountered a similiar issue. The lod algorithm seemed to be very aggressive… don’t know whether this came from the scaling. I used setLocalScale() like you aswell.

We need to wait for Sploreg to answer since he’s the terrain guy, I guess.

When you create your terrain you will want to modify the LodDistanceCalculatorFactory and change the lodThresholdSize; maybe multiply it by the scale of the terrain. It does a straight distance check by default, so scaling the terrain will affect it.

I will see about changing it tonight, but let me know if that fixes it for you.

Hi Sploreg,

ok, will do that aswell. Could you please also look into this thread:

It bothers me at the moment quite a lot. Thank you! :slight_smile:


sure I will take a look :slight_smile:

Ok, I just committed a fix. The distance calculator was not taking into account the terrain’s scale so that threw the calculations off and they stopped prematurely, causing holes.

Looks good now for me in my case! Kudos :stuck_out_tongue:

Hi Sploreg,

sorry for the late response. thanks a lot for the fix.