Flickering Objects

frogpipe

Yesterdayz Trainz Member
frogpipe_20121227_0000.jpg


Note in this image that the 2 track bridge has both light and dark patches. What you can't see because this is a still shot, is that they flicker quite rapidly. There are other objects that do this too, and places where objects go "below ground" can also show this effect.

I'm guessing that since that bridge casts a shadow, that the shadow mesh is co-located (either exactly co-located or very very closely located) with the main mesh and that's what's causing the flicker, but I am wondering if there is anything that can be done to fix it other then editing the asset. Something like graphic settings.

nVidia GTX550, winxp, directx (cause it's faster then OpenGL).

I seem to recall other games some time ago having a "z-offset" to stop "decals" from doing this exact thing....
 
Last edited:
Ted,

You hit the nail on the head. These is called coplanar faces, and is caused by the video card trying to display two very close planes. In the normal circumstances, it would display only one flat surface, but with two very close together, it gets confused and will flicker between the two. As you noted, the z-buffer is messed up, and by using that option not available to us, it can fix the problem. When this happens on the terrain with stations and track, it's an easy fix by lifting the object up just a smidge off the surface. In cases such as this, and those that have night meshes too sometimes, it can't be fixed because the planes are too close together and get in each other's way.

John
 
Frak.... I'm familiar with the co-planar faces (though I forgot the proper term) but I was hoping there was a setting hidden away somewhere... Ah well. Maybe I can make smaller shadows using PEVs quickshadow... Or something...

(grumble grumble) Me thinks Trainz 12 should be call Trainz 98....
 
That's why when I use shadows on objects I reduce the shadow mesh to 95 to 98%. That stops the shadow flickering. Pev's shadow mesh program may fix it, I don't know as I've never used it.
 
Nah, Ted! You'd think it would be that easy.

Clem is right on with the way to do it.

It's too bad that the shadows aren't generated dynamically instead as mesh objects. That would solve the problem completely, I think. Your analogy of Train 98 is a good one. In some ways the program is quite advanced, yet in some areas it's way behind. Now if we could get the behind area to catch up, we'd have a perfect sim.

John
 
Does this only apply to stationary objects, (bridge, buildings...) or to locomotives also? If so, should I reduce my shadow size accordingly on my locomotives?

TB
 
Does this only apply to stationary objects, (bridge, buildings...) or to locomotives also? If so, should I reduce my shadow size accordingly on my locomotives?

TB

With the locomotives and cars, you can use PEV's Quick Shadows to create the shadow mesh. This does a nice job with no fiddling.

John
 
With the locomotives and cars, you can use PEV's Quick Shadows to create the shadow mesh. This does a nice job with no fiddling.

John

That did not answer my question. :o

To be more specific. Do shadows on locomotives or rolling stock suffer from this issue? OR should they be reduced in size by 2% as mentioned above?

TB
 
AFAIK the shadow mesh isn't supposed to be visible in game.


mesh-table
{
default
{
mesh "bogey.im"
auto-create 1
}

shadow
{
mesh "shadow/shadow.im"
auto-create 1
}
}

Wrong, that will make the shadow mesh visible and give the flickering effect, or a black blob sticking out at odd angles.


mesh-table
{
default
{
mesh "bogey.im"
auto-create 1
}

shadow
{
mesh "shadow/shadow.im"
}
}

That works, or;


mesh-table
{
default
{
mesh "bogey.im"
auto-create 1
}

shadow
{
mesh "shadow/shadow.im"
auto-create 0
}
}

Is also kosher. The shadow mesh is the one that should NOT auto create in the mesh table, if that's on it should be off.
 
You are correct Sniper the auto create should not be on, in fact I don't even put auto create in the shadow table at all, but the shadow is still going to show in game IF the shadow feature is turned on. Thus the need now for the shadow mesh reduction.
And to answer TB. Yes all shadows need the reduction AFAIK.
 
Back
Top