FSX DX10 Flashing Textures Part 3

I decided to compare the way that that runway is drawn using DX9 with DX10. This is DX9

So when using DX9 it draws the surfaces with the ZENABLED option (so the depth is tested) but ZWRITE is disabled. This means that after the depth check the depth of the new pixel is not recorded in the depth buffer. This means that the runway layers cannot obscure each other – they are drawn on top of each other with the last layer winning any overlap.

Going back to DX10

The first lower layer is drawn with DepthEnable TRUE but the DepthWriteMask is ZERO. The DX10 terminology is slightly different but it means the same thing as above.

Then the taxiway is drawn with a NULL DepthStencil – the DepthStencil state shows as emprty in the Intel GPA and in the trace I see it set to NULL.

The default settings used if the depth Stencil is NULL is DepthEnable TRUE and DepthWriteMask ALL.

So the difference between DX10 and DX9 is that for DX10 the depth of the taxiway is recorded in the depth buffer.

Then the runway is drawn with the same stencil as the first layer so with DeptheEnable TRUE but the DepthWriteMask is ZERO. Thus in DX10 mode its possible for a pixel from the taxiway to hide the runway as the interpolation/rounding of its recorded depth is fractionally less. This never happens in DX9 as the taxiway pixels are not recorded in the depth buffer.

So that’s the problem. I wonder if someone in Aces team working on taxiways thought that the default when the Stencil was set to NULL would be not to write to the depth buffer? The Remarks section which states the defaults is only in the DX11 documentation – perhaps it wasn’t clear at the time what the defualt should be?

As an experiment I tried ignoring any changes of stencil to NULL in my DX10 C++ wrapper. As expected this stopped the runway flashing. Most of the scenery seemed ok with this change but when I turned aircraft shadows on it crashed!

About stevefsx

I don't use FSX that much. But I am very annoyed when it doesn't work properly!
This entry was posted in DX10, Runways. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s