Game Development Community

Lod In Tse?

by Robert Norris · in Torque Game Engine Advanced · 01/04/2006 (3:13 am) · 6 replies

Hi,

could it be that LOD in the TSE doesn't work?

We have some objects using LOD in our first mission to reduce the polyCount. In the ShowTool the Detail Levels work fine, but in the TSE they don't. I've looked into tsShapeInstance and found some detail level functions where the code was fully commented out, returning 0 instead. The debugger stops there for our LOD Objects...

Is this the reason why our Object LODs don't work in TSE?
And if that's the reason: Will there be a LOD support in TSE soon? This is really an important feature for our game, because we have some Models with high polyCount and there will be more...

regards
rob

#1
01/04/2006 (6:51 am)
Ok, i've fixed by myself.

If somebody needs LOD, do the following simple change in tsShapeInstance::selectCurrentDetail2() and tsShapeInstance::selectCurrentDetail2Ex():

replace
dglProjectRadius(...)
with
GFX->projectRadius(...)


AND

dglGetPixelScale() with 'pixScale' (see below)

RectI viewport = GFX->getViewport();
F32 [b]pixScale[/b] = (F32)viewport.extent.x / 640.0;

This works for me.

regards
rob
#2
01/06/2006 (1:51 am)
Thanx Robert. It works for me too.

Any Idea about update this function :
S32 TSShapeInstance::selectCurrentDetailEx(bool ignoreScale)
{
   MatrixF toCam;
   Point3F p;
   dglGetModelview(&toCam);   //<====== Here is the error
   toCam.mulP(mShape->center,&p);

It make a compile error on this line :
dglGetModelview(&toCam);
#3
01/06/2006 (3:34 am)
Vincent,

i've made it in this way, but didn't post, because i don't know if this is the right way to do it

MatrixF toCam = GFX->getWorldMatrix(); //is this correct? Should be Modelview

Somewhere i've read that the Modelview must be calculated out of the world- and the projectionmatrix. So no garantuees here.

regards
rob
#4
01/06/2006 (4:01 am)
Thanks Robert. It seems to work.

May I abuse, and ask you if you have any Ideas for Fog rendering?
#5
01/06/2006 (4:17 am)
No Ideas, sorry :o)
#6
01/08/2006 (1:59 am)
Try asking MattF nicely. :)