Model LOD?

Started by
10 comments, last by Ranger_One 20 years, 4 months ago
Would using a Level Of Detail (LOD) setup for regular game models improve speed when drawing many distant models and onlly a few local ones? I''m thinking of making two or more levels of detail of each model. Each would have progressively less faces than the last. Then draw the degraded versions at distances where the model would take only 64x64 pixel screen area for instance. Would this be worth the effort? and if so- can anyone point me to good code that can decimate vertices from a surface? Ranger
Advertisement
Many sport games do this with their player models. If you look for it in replay (zoom in and out), the change from one level to another is usually very obvious. But, that''s only if you look for it. It is generally a good thing to do. Whether they do it on the fly or not, I don''t know, and it probably would depend on the game. Ie, either have your artists do a 4000, 2000 and 1000 poly version for every model, or do it programmatically. I don''t have any code for it though.
Heh, if you REALLY want to do LOD, you can look into a game called Messiah, it explains how they accomplished. Basically, it stores information pre vertex on which vertex to break down next (by seeing the angle of the edges, less defining polygons are "merged" before more defining ones, and in real time). I forget what the method is called, but it''s pretty cool. The characters in Messiah where over 200,000 polys a piece (with a bunch of them on screen at once) and was targetted at TNT/Voodoo2/400-500 mhz machines and worked great on them.

Billy - BillyB@mrsnj.com
(Hey, I''''m no longer anonymous!)
http://www.messiah.com/Html/technology.html
quote:
200,000 polys a piece (with a bunch of them on screen at once)

200,000 in 3ds max, not on the screen. He mentions 2000 for a reasonable amount (with a few+ on screen). All those tools would be sweet to have...
Ready4Dis:

That''s called a progressive mesh. Unfortunately, it isn''t so attractive anymore as it used to be in the days of Voodoo2/3. Modern 3D cards expect a static vertex / index data stream to operate at maximum speed. The less the data changes, the better and the higher the framerate. Prgressive meshes change every frame, so the 3D card can''t cache anything.

The best thing to do today is used selected LOD versions of your model, and switch between them depending on distance. To make the transition less noticable, you can use vertex shaders to interpolate between vertices (geomorphing).

/ Yann
How in the world can u have 2 models with different vertex/triangle counts, stored I assume in different streams and have a vertex shader interpolate between them? I think this is a stupid idea but if u can enlighten me more, perhaps I could be persuaded to consider myself stupid instead.
quote:
How in the world can u have 2 models with different vertex/triangle counts, stored I assume in different streams and have a vertex shader interpolate between them? I think this is a stupid idea but if u can enlighten me more, perhaps I could be persuaded to consider myself stupid instead.


Hehe.. OK, here we go: of course you can't have two different streams with different vertex counts processed on a single vshader. So what you do is the following: normally, the phase of transition is rather short compared to the period a full LOD model is displayed.

So say you want to blend between a 3000 vertex and a 1000 vertex model. You first create a temporary model where you take your 3000 vertex model and apply all the optimizations you applied to get the 1000 vertex one. But *without* removing faces or changing the mesh topology, only vertices are repositioned. This will create lots of 0 area triangles, but that's no problem, 3D hardware will cull them. This can be done as a preprocess and stored along with the model.

Now, you feed your original full blown 3000 vertex model data into the vertex data stream, as usual. And in parallel (since topology is the same, there is a 1:1 vertex match), you feed your faked 1000 vertex model (that still has 3000 vertices, it just looks like the 1000 one) into a user attribute channel (in OGL that's glVertexAttribPointerNV(), not sure about D3D). You put your global interpolation factor (between 1 and 0) into a constant register.

In your vertex shader, you simply perform the following equation: Final Vertex Position = Vertex Stream * factor + Attribute Stream * (1-factor).

Here you go, perfect geomeorphing on the GPU in one stream. Once your reach a factor of 0, the model will look like the 1000 vertex one, and you can safely switch LODs, no change will be noticeable.

Edit: of course, in real world application, you would also need to interpolate between texcoords, normals, whatever else you need.

/ Yann

[edited by - Yann L on May 1, 2002 3:07:33 PM]
nice
except that now u have 2 3000-vertex models instead of 1. That 6000 vertices used to make a smooth transition from 3000 to 1000. I guess since it''s used for hardware, that isn''t a concern but as far as LOD methods go, this kinda sucks.
But for geomorphing on a fast GPU, yeah it''s a good method.

This topic is closed to new replies.

Advertisement