Shadow cost and LOD

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
BobTheFish
Posts: 10
Joined: Mon Oct 13, 2008 6:21 am

Shadow cost and LOD

Post by BobTheFish »

How expensive in terms of performance are Irrlicht's stencil shadows? Is cost per-polygon, per-light or what?

Does Irrlicht have dynamic mesh LOD generation?

I'm making a game which involves large numbers of models at far distance but very few at close distance. I'd like them to be shadowed in either case, detailed up close and very low polygon/texture detail far away (to increase performance).
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post by Halifax »

The stencil shadows in Irrlicht are very expensive, and increase in expensiveness with the number of polygons. I recommend that you check out BlindSide's XEffects project which implements shadow mapping.

No, Irrlicht doesn't currently have dynamic LOD mesh generation. I can recommend edge elimination as something you should look into for LOD mesh generation though. It works pretty well, and is very simple to implement.

Basically, for edge elimination, you do dot products on the triangle normals. You then compare the dot product against a tolerance value. If it is lower than the value, you reduce the two triangles, but if it is above, then you keep the triangles.

So edge elimination can be used to reduce polygons, while still preserving the general likeness, or it can be used (with a high tolerance value) for an aggressive LOD approach for when the mesh is a little bit further from the camera.

I hope that helps.
TheQuestion = 2B || !2B
BobTheFish
Posts: 10
Joined: Mon Oct 13, 2008 6:21 am

Post by BobTheFish »

Halifax wrote:you reduce the two triangles
How? I'm not sure what this means.
I hope that helps.
Thanks, it does.
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post by Halifax »

BobTheFish wrote:
Halifax wrote:you reduce the two triangles
How? I'm not sure what this means.
You collapse the edge, by taking the first endpoint to the second or vice versa.

To be honest, I don't know why I haven't taken a stab at edge collapsing for Irrlicht. I think I'll give it a try.
TheQuestion = 2B || !2B
Post Reply