Testing Drawcalls

Today I intend to do some testing looking at the “master” DX10 bug. I wanted to use default scenery so I picked North Africa. Now I previously said that I thought that the granularity of drawcall batching was QMID 14. However testing at Zwara seemed to show that I was wrong and that it must be either QMID 11/12 which is actually good news as it will make the problem much rarer.

So I moved to Tripoli. There is QMID 12 (and QMID 11 as well) boundary cutting the airport towards the west.

To perform the test I created a box with a green grass like texture, and added an alpha channel. The material was set to blend Source Alpha/ Inv Src Alpha, and here is the result.

The box nearest me is not transparent whereas the one the other side of the boundary is.

Now I must confess another thing that didn’t happen quite as I predicted. I had previously said that the tile nearest you was drawn last and so I expected the boxes to switch appearance as I crossed the boundary but that did not occur. So there is some level of stickiness.

Disable Draw Call Batching

Since I used GMAX draw call batching was initially disabled, so for the test I had to use Arno’s ModelConverterX to enable it. In the next test I disabled draw call batching

So this works and is a simple workaround. There is a performance cost, but for a model that is used a few times at an airport this will be insignificant.

Cloning Model and Texture

So this time the new model is updated to use a different texture grass2

Works as expected.

Cloning Model

The next technique I wanted to explore was cloning the model and giving it a different GUID whilst retaining the same texture. What I am interest in is whether the batching is organized by object or texture. I assume the former.

CORRECTION!   I previously said that this worked.   Repeating the test showed that I was mistaken.  I had accidentally left drawcall batching disabled on the cloned object.  Repeating the test with drawcall batching set correctly the result was the same as with the original model on its own.

So cloning the model whilst using the same texture does not work.

Conclusions

Faced with an airport with a Tile boundary that causes transparency issues e,g with grass or shadows there are two techniques available.

  • Disable drawcall batching for the model. This is very simple to do but will increase drawcalls. However if we are dealing with perhaps a dozen shadows that might be fine – with hundreds of grass instances it would not be a good idea.
  • Clone the model and give the clone a different GUID. Clone the Texture and give it a different name. Update the cloned model to use the new texture. Use one model one side of the boundary and the other on the opposite change. This has no performance cost but is more work.

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 Drawcalls, Uncategorized. Bookmark the permalink.