Game Development Community

Water specular map?

by Dumbledore · in Torque Game Engine Advanced · 01/29/2009 (4:58 pm) · 1 replies

Has anyone managed to get a spec map texture working for the new water in TGEA?

I am just wondering if anyone has done this since it would be handy for having water follow a set shape around islands and not go all the way through the terrain and would remove the water clipping into the terrain at far distances when one looks at the terrain from a distance.

#1
01/30/2009 (1:23 pm)
Yup, got this in and it was simpler than I thought.

You got two options, either you use depth information or you precalculate it. We went with precalculation because you don't have access to depth and we didn't want to work trough all that.

Basically, we keep a DDS compressed depth map around and sample from it. It's much cheaper than doing it each frame, but dynamic objects (ex: players) won't make the water less opaque.

Z-fighting is much less noticable this way, and the water looks alot more waterish and smooth. Hope that helps!

Edit: If you feel like sacrificing fillrate for video memory, you could also increase the number of quads and make sure quads that are totally transparent or opaque occupy the same pixels (ie, just one) on the sampler. You could also merge shapes that are very similiar. The precalculation pass takes longer this way, but there's no difference (except for more quads to render and that the bitmap which you sample can be smaller)