PDA

View Full Version : OT? rendering a static ammount of polygons for any scene



BlackSoftware
06-03-2003, 10:05 AM
I'm trying to design a rendering technique which will render close to the same number of polygons all the time (for more predictable performance and visual consistancy). in other words, the number of polygons to be drawn for any particular object/heirarchy is determined soley by it's distance from the viewer.

there are 2 ways I have thought about doing this.

one way is to pre-calculate a large set of vertecies for every object and keep them stored.

the way I plan on implementing it is to hardcode almost no vertecies and have every model built from primitives defined by equations. the number of iterations spent on each equation/polyhedron is relitive to the distance from the viewer.

I've seen the polygon subdivision in OGRE but has anyone seen it implemented in a global model?

[This message has been edited by BlackSoftware (edited 06-03-2003).]

jwatte
06-03-2003, 10:18 AM
Look at VIPM (Viewer Independent Progressive Meshes). They allow you to specify a specific poly count, and then the mesh gets rendered with that poly count. They also allow you to specify a maximum acceptable error (in pixels) and it gets rendered with the minimum number of polygons that achieve that error.

Typically, these are implemented using sliding window triangle lists over a fixed vertex array, so they're very efficient to render and store in memory, too. Basically, each lower-detail mesh is a subset of the higher-detail mesh verts, and you can sort verts from most-important to least-important to make it so that you always draw all verts from 0 to N in the array, where N is the desired vert count. Then you arrange the triangle lists to "slide out" triangles on the left side, and "slide in" replacement triangles on the right side, so it's all contiguous (but you only use a subset of the list at any one time).

Ogre isn't all that great for sample code; they don't even draw geometry in vertex arrays last I checked.

Coriolis
06-03-2003, 01:39 PM
Continuous lod has drawbacks. It doesn't run in constant time, for example, so your lod calculations may cause fluctuating framerate even with your game poly count identical. Also, curves behave really badly with continuous lod where each lod has to use vertices from the highest lod; a tube made of 8 vertices has to go down to 7 vertices by ignoring one, making it flatter on one side. You also restrict how your models can be built and have a lower bound on how much you can lod, because you can only lod out a vertex if the interpolated vertex parameters such as texture coordinates would not take a radically different path through the skin.