Sunday, July 4, 2010

Updates for 4th July 2010

First of all it's a happy wotsit to my American readers. Drink lots of root beer, eat your mom's pie, and don't flunk math now, y'hear. ;)

Anyway, I decided to bite the bullet and implement a full HLSL path for 1.8.5 (must remember to stop calling it that). This is the preferred alternative to the fixed functionality path, and is enabled by default if your 3D hardware supports Shader Model 2 or above; you can switch it off with r_hlsl 0 if it causes you trouble, of course.

In terms of quality I've tried to keep the 2 paths as close as possible. Naturally there are some parts of the renderer that are always going to be better with HLSL as it can perform it's operations per-pixel instead of per-vertex. These would be water and sky, so nothing much has changed since 1.8.4 in that regard.

In terms of performance the HLSL path should eat the fixed path for breakfast most of the time. A big win is sky, which runs considerably faster using HLSL than it does with the fixed path. Nothing much changed since 1.8.4 there either.

So what is different then? At present it's really all just behind the scenes stuff. By having pure HLSL all the way (or pure fixed all the way if you set r_hlsl 0) what we have is a cleaner and more consistent renderer with none of the "funnies" you tend to get if you try mixing HLSL with fixed in the same path.

Longer term things will get faster or better in certain areas. A lot of the overhead of particle setup can be shifted to a vertex shader, for example, meaning that particle-heavy scenes should become more efficient. Likewise there may be scope for reduction of vertex submission overhead elsewhere; this will need to be examined on a case-by-case basis.

About the only thing left that I haven't migrated is the skybox, the main reason being that I'm not too certain how the automatic texture coord generation I've used for it is going to work out. As soon as I knuckle down to do it I'll know, of course.

The rest of the items remaining on my to do list have been joined by a few more, but overall it's coming together quite well. Most of them are just relating to tidying up of loose ends at this point in time, but some of those may need a bit of work.

The big one is the sound restart crash. I've determined that it only seems to happen when you're accessing the menus, so for now the solution seems to be to just remove the offending items from the menu. When I port the Q2 (or Q3A) sound code things should get a lot better.

Overall today I got almost nothing done, but did test quite heavily, running through most of e2 and e3, as well as Masque of the Red Death. Performance remains quite solid, and handling of some of the more intense moments in Masque is impressive. A lot of the testing was also "slow machine testing", using a VMWare XP session and VMWare's video driver. Getting a solid 72FPS on ID1 maps with that is a great result, even though it struggles to go higher (it can manage 125FPS timedemos though).

Tomorrow I hope to hit the skybox code and get that one off the list. Till then.

0 comments: