Skip to main content
gamedev.net
🔒 Locked

LOD

Started by HiddenInBSP Aug 9, 2002 at 7:14 AM 3 replies 750+ views
Original Post
HiddenInBSP
HiddenInBSP
I''m currently programming a terrain engine, and I''ve implemented a LOD to speed it... At this moment, the FPS is good, but I have only implemented the terrain (there is no unit...) Does a LOD is enough to make a fast game or have I to use other techniques: BSP...?? THX for your time...
Subotron
Subotron
Well... if you want to make a decent terrain engine LOD only is far from enough... you see a big terrain consists of thousands and thousands of polygons. OpenGL will draw them all if you don''t do something about it, no matter if those polygons are visible or not. You say you''ve implemented LOD. This surely gives you some speed, but it doesn''t do anything about OpenGL drawing all the polygons in your terrain. A good thing to start with is frustrum culling. This is a relatively easy way to check if a shape is in your viewing frustrum (if an object is in the viewing frustrum, it''s visible)

This method saves a lot of speed since it lets OpenGL render only the polygons which are actually seen. This is not all yet though. If you really want to gain a lot of speed, use BSP or octrees. If something is in your viewing frustrum, it''s not necessarily visible. If something is standing in front of it you still won''t see it, but OpenGL will render it, even with frustrum culling. If you use BSP or octrees to divide the landscape in different parts, you can see which parts are behind others. Using this you can draw only the objects which are REALLY seen, the ones in the viewing frustrum and not behind other objects. If you''ve coded all this you have gained an incredible amount of speed... believe me. Some sites to check out:

Good frustrum culling tutorial:
http://www.markmorley.com/opengl/frustumculling.html

Octree examples:
http://www.gametutorials.com

HTH
HiddenInBSP
HiddenInBSP
THX for this post...
In fact I have implemented a quadtree (not exactly a quadtree, but it permitted to cull all polygons that are entirely outside of the frustum (using a bounding box for the frustum).
But my game is a sim-city like in 3D, so the problem is that the BSP would speed up the landscape rendering, but the BSP wouldn''t stand with the batiments (that are not static)...
So my question is: Considering the batiments, is it a good idea to use BSP instead of quadtree?
Sander
Sander
I would stick with a Quadtree and some form of distance based LOD. In a simcity like game, there are many objects represented on the terrain. Simply assign each object (building) to a node of the quadtree same as the terrain patch object. If you draw the terrain, also draw the buildings required on it.

For the distance based LOD you should check the article sections of GameDev.net. There are some pretty good one''s. The basics of it is that you have multiple versions of an object. Each one with less and less polygons. The further away an object is, the less detailed object you draw. This would reduce polygon count greatly and thus speed up your engine.

Greetings,


Sander Maréchal
[Lone Wolves Production][Articles][GD Emporium][E-mail]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.