Game Development Community

Transparent GFXDrawUtil Rendering and Water

by Mikhail Elbert · in Torque 3D Professional · 10/20/2010 (8:08 pm) · 1 replies

I have a question with regard to rendering a polyhedron using GFXDrawUtil and water. Note: the polyhedron renders only using GFXDrawUtil and doesn't use a mesh.

I am trying to render a partially transparent polyhedron using GFXDrawUtil so that it has the following properties:
- When the polyhedron is drawn over water and part of the polyhedron is below the water, the part below the water appears submerged (this is similar to how TSStatics are rendered in water).
- The polyhedron renders partially transparently over the water.


This works correctly in basic lighting. The object that renders the polyhedron has a separate renderbin (of type RenderObjectMgr) that renders after the water renderbin (otherwise, the water always renders over the polyhedron). The stateblock is set as follows:

GFXStateBlockDesc desc;
desc.setZReadWrite( true, false );
desc.setBlend(true);


For advanced lighting, there is a bug where if the partially transparent polyhedron is rendered over water, the transparency doesn't show the water (it blends the transparent polyhedron to the terrain under the water). This is rendered in the regular object renderbin. The object submerges in water by enabling Z buffer writing in the stateblock:

GFXStateBlockDesc desc;
desc.setZReadWrite( true, true );
desc.setBlend(true);


I was wondering if there is a way in advanced lighting to have the transparent polyhedron blend with the water.

Thanks

#1
11/01/2010 (8:08 pm)
Any one have an idea on where to being with this?