Enabling LOD in drawing terrain

i drew a terrain and disabled LOD and every thing was fine but when i enabled LOD and move the camera the program was slow.
i think we use LOD to render faster but i cant see fast rendering when i enable it.
i want use LOD in a very big terrain.
please help…

Can anyone help me?

You know, if the terrain is fine without LOD, why don’t you just not use LOD?

Thank you DangerOnTheRanger
because i test only terrain and i think if my scene has many models i have to use LOD in the terrain and in my models.
I think there is a bug or something that i dont know about using terrain with LOD.

What framerate are we talking about here? What does “fast” and “slow” mean?

Thank you coppertop
When i use setBruteforce(True) and move the camera my program’s frame rate is something around 60 but when i use setBruteforce(False) and move the camera my program’s frame rate is some thing around 20 or sometimes 10.

I’m not into terrain, but do you use setAutoFlatten? If not, you may have run into a problem of having too many meshes.

Note that it’s generally faster to render one mesh (as with Bruteforce enabled) than to render many smaller ones. In general, you will have to experiment with LOD settings and use AutoFlatten if you want it to look good and run fast.

Thank you coppertop
It is very funny. In theory we use LOD to render faster but when i use LOD in panda3d, it renders slower.
Is it a bug?

I doubt this is a bug.

I think what you’re running into, is the fact that your map is actually too small for you to gain performance using LOD.

I think coppertop is right in, the fact that you have too many meshes, from using LOD

In your case, (without knowing more details) I’d have to say that using no LOD (on the terrain, that is) is probably better for you.

Hope this helps you out a bit,

It’s not a bug for sure. It’s also not a feature :wink:. It’s just the way graphic cards work.

Graphic cards do a very good job at rendering millions of triangles, as long they’re in one mesh. But supply it with a couple of hundred individual meshes (even as simple as cubes), and you’ll make it crawl.

It’s not as simple as “LOD makes things faster”. LOD isn’t a magic bullet but merely a tool, it has to be used the right way and where applicable.

If you enable Bruteforce, the terrain is rendered in one piece. That’s the fastest you can get, as long as your terrain is relatively low resolution (as in, the resulting mesh has less than 1 or 1.5 million traingles – but don’t take that figure for granted, it depends on the rest of the scene and lots of other things).

LOD makes sense only if you have a really large terrain. LOD with automatic flattening (if I’m right, and I may not be on this one) only makes sense when the whole terrain will be visible at once, otherwise it will break culling, which could provide better performance.

Automatic flattening, which can allow you to use LOD while benefiting from single mesh rendering, also comes with a price, because it also takes time. So if you have a terrain with LOD that will be culled often and/or if you have it divided into few large chunks (that’s Block Size, IIRC), then it might also make more sense to leave automatic flattening out.

Take what I write with a grain of salt, because I’m not really into terrain, but that’s general rules that apply to all real-time graphics, and I see no reason why it wouldn’t apply to terrain.

Thank you my friends.