- Home /
Unity Terrain - can I control a Level of distance (LOD)?
Hello guys, I created a terrain using build-in tool in Unity. I set a pixel error to a higher number to lower the resolution. I set pixel error from 5 to 10. Everything seems fine until I zoom out the camera a little bit. I attache pictures so you can see what is happening. In the first picture the terrain is fine using MainCamera orthographic size 10. But when i zoom out the camera to the size of 40 and more, you can see what is happening on the second picture. Why is this heppening? Please help, I tried to play with the terrain and camera settings but no use.
That just looks like the terrain working to me - the whole point is that it dynamically adjusts the mesh resolution the further that a point is from the camera. What if you set pixel error to 1?
Hi, thank you for your response. If I set pixel error to 1 it gets smooth and I get a perfect lode but I need to optimalize this terrain for a mobile. With pixel error set to 1 I have 1$$anonymous$$ tris if I set to 10 I have 100$$anonymous$$ tris - big difference. It seems strange to me that when the camera gets further from the terrain it gets a bad quality. $$anonymous$$aybe you are right about dynamicall adjustments. Can anyone asure this or does anyone know the reason why is this happening?
Like I said, that's how it's designed to work. It's trivial to test by setting your scene to wireframe mode and moving your camera around - the parts of the terrain mesh closest will have high vertex density, beco$$anonymous$$g less so with distance. That's the main benefit that the terrain component offers over a simple planar mesh.
LOD is Level Of Detail. It's normally used to refer to a set of high/low poly meshes, or complex/simple shaders that are swapped out at runtime to achieve a balance of quality -vs- detail.
The terrain mesh is dynamic to increase resolution or nearer sections but doesn't quite work the same as LOD - the only way you can control it is with the pixel error setting you have alreasy discovered.
Well, Pixel error just improves the terrain mesh. The less the Pixel error is the more Tris are rendered. But it has nothing to do with LOD to me. I need to adjust the thresholds in LOD. For example I have two LOD levels. First one is the default, the second one is triggered when camera distance is about 100 meters away. I need to adjust the 100 meters parameter. For example I need to trigger the second level when camera is 150 meters away. Is it possible? Isn't this available in PRO version at least? Does anyone know?