Monday, April 19, 2010

Disabling Multitexture in DirectQ

In current versions of DirectQ you can't disable multitexture, and furthermore a minimum of 2 texture units are required to run. From 1.8.4 onwards you will be able to do this, and DirectQ will support 1 TMU devices, but it will be a somewhat downgraded mode.

Let's discuss this a little. Recieved wisdom is that disabling multitexture can make some maps run faster. The reason why is that GLQuake's multitexture implementation is somewhat botched, and the non-multitexture paths may be preferable as they do better state batching. (There's also GLQuake's horrible old mirror hack, but we don't talk about that round my way.)

This isn't actually necessary in DirectQ. I've tuned the engine to do state and primitive batching, and it's capable of extracting full performance from maps and scenes where you would normally expect Quake to be brought to it's knees. Try it and see. Run some maps that are known performance killers and see how it goes.

So the only reason you would have to disable multitexture is if you know you have a bug in your driver and you know that a driver update doesn't fix it. Otherwise you may possibly be damn well going to disable it and nothing will stand in your way.

Anyway, about that downgraded mode. Not using multitexture in DirectQ will also disable fullbright colours, alpha on brush models and dual sky layers. Bottom line is that it adds complexity to the code, thus making it harder for me to test, debug and evolve. It is also intended for low performance cards, and as such these effects will only drag down something that is already running slow.

It also completely bypasses the batched primitive/vertex buffers path for world surfaces, meaning that if you use it to try and make a big, complex scene run faster, it will actually run quite a bit slower instead; currently about one-sixth the speed (i.e. back to DirectQ 1.7 and earlier levels). Yes, this is intentional. Firstly, as I said above, you don't need to disable multitexture to make these run faster. Secondly, the 1 TMU path is intended for low end cards that will derive no benefit from primitive batching or VBOs.

So the deal is, if you want to run DirectQ on a 1 TMU device you will be able to. If you want to disable multitexture you will also be able to, but beware that the end results are the opposite of what you would expect from GLQuake.

0 comments: