[suggestion] use triangle fans instead of triangle lists

Jon

07-11-2005 05:29:36

Me again.

I was nosing around the SceneManager class (trying to answer the question 'how is a renderable written to hardware') when I came across something which might be interesting.

(imagine my embarassment if this code isn't used by PLSM)

OgreSceneManager::renderSingleObject has a member RenderOperation, which appears to be initialized with a op code for processing triangle lists. Now, this is a safe choice for most things, but for terrain I would imagine that a triangle fan would be a more efficient render.

Its sort of a pity that the operation is static (I would expect this to be a good candidate for a member of the renderable). The current code appears to use the same render op for everything rendered.

There must be a reason for this, you say? Perhaps the object is 1G in size? Nope, maybe about 20 bytes + vtable.

Anyhow I came across this while making sure that my chopped up renderable idea could be rendered without breaking anything.

tuan kuranes

07-11-2005 12:56:06

Triangle list is by far the faster render operation on modern cards.
that's why I didn't even bothered to make it tweakable.

Ogre TSM has a Tristrip option. Try it with big terrain and you see a quite big fps loose. Could easily be ported to PLSM2 (terrainrenderable and paginglandscaperenderable objects are nearly the same), but has to be debugged first. (it's not perfect for now.)

Patch welcome.

Srekel

07-11-2005 14:40:21

Are triangle lists faster than triangle strips? That sounds very wierd, given what I know. Of course I'm not that updated, so I might very well be wrong. Do you have a link to an article or something that explains it?

tuan kuranes

07-11-2005 14:46:20

http://www.ogre3d.org/phpBB2/viewtopic. ... 8261#38261
and
http://www.ogre3d.org/phpBB2/viewtopic. ... 4554#64554
and
http://www.ogre3d.org/phpBB2/viewtopic. ... 4348#44348

Jon

07-11-2005 15:23:21

Sorry for bringing this up again, I obviously didn't search the main forum. Anyhow I was thinking strips and wrote fans, so was even more confused than I appeared.

At least I got some pointers to some interesting reading material.

tuan kuranes

07-11-2005 15:27:17

note that I'm not against Strip memory reduction against 10% speed. (specially if that speed boost occurs only on shaders capable cards)

But this mean serious coding session on that stripping code, that leads direclty to big headeaches.

So I leave it open to patchers ;)