setDetailFromDistance - beta 5
by Ivan Mandzhukov · in Torque 3D Professional · 08/23/2009 (10:45 am) · 2 replies
Choosing the pixelscale of details is intended to work well on widescreen monitors.
I got very different lod results on a 4:3 screen.
tsShapeInstance.cpp
should be replaced with:
Now it is OK.
Those users, used to the TGEA lods will see the difference.
I got very different lod results on a 4:3 screen.
tsShapeInstance.cpp
S32 TSShapeInstance::setDetailFromDistance( const SceneState *state, F32 scaledDistance )
{ ...
const F32 pixelScale = state->getViewportExtent().y / 300.0f;
...}should be replaced with:
F32 pixelScale; F32 ratio = state->getViewportExtent().y / state->getViewportExtent().x; if(ratio<1.5f) pixelScale = state->getViewportExtent().x * 1.6f / 640.0f; else pixelScale = state->getViewportExtent().y / 300.0f;
Now it is OK.
Those users, used to the TGEA lods will see the difference.
#2
Yesterday i tested the lod transition in TGEA.
Then i imported the same model with the same scene in T3D.
Lod distance switching was very very different,compared to TGEA.
I needed to take away twice the distance of TGEA to switch to the next lod in T3D.
You can easily count the pixels on the screen to see there was something wrong.
Then i counted down the screen pixels in TGEA (same resolution) and everything was correct.
08/24/2009 (5:01 am)
Tom,there is no need of screenshot.Yesterday i tested the lod transition in TGEA.
Then i imported the same model with the same scene in T3D.
Lod distance switching was very very different,compared to TGEA.
I needed to take away twice the distance of TGEA to switch to the next lod in T3D.
You can easily count the pixels on the screen to see there was something wrong.
Then i counted down the screen pixels in TGEA (same resolution) and everything was correct.
Associate Tom Spilman
Sickhead Games
In theory it should be the same LOD on 1024×768, 1280x768, or 1366x768 in either TGEA or T3D.
If not then its a bug.
I don't think the fix you posted is the one we need... it shouldn't be conditional. We need one algorithm that gives us the same results as TGEA while using the Y extent.