Thursday, January 7, 2010

HLSL Alpha Water Warp is Done

That was fun. The structures I had set up for the world make this kind of thing really easy and fast now.

Water surfaces are included in the correct back-to-front alpha sorted list along with every other alpha object, and there's a mini state change manager at work. It's quite a nice looking piece of code too.

I also set up the state changes needed for the non-HLSL warp, but there's a bit of tidying up to be done first. For starters I've realised that my water alpha render path can be totally reused for regular non-alpha water, so I want to amalgamate the two. Secondly I have some unnecessary state changes and function params I need to remove. Thirdly is it doesn't integrate too well with particles as the regular non-HLSL state change manager intercepts the setup of a particle batch following a HLSL water batch and discards the changes. That bit's easy, I just need to write a particle state takedown function that ensures the correct states get triggered (or add it to the water state takedown so it would apply to other object types, which seems more correct).

Overall I'm quite pleased with the extent to which I've brought things on. I always knew that as soon as I managed to get the old legacy code out completely things would start moving fairly fast.

1 comments:

Coranth said...

Whew... damn, ID Software need to hire you or something! So... once the engine is done, the graphics might need a touch up. I wonder... you wouldn't know about any kind of detailed, or high-resolution texture mods for Quake, would you? Hmmm....

Anyway, awesome work, man. I'm looking forward to playing this!