[w]tech combines next generation technologies like full dynamic lighting, voxel based terrain and bullet physics, which are brought to you via a self-explanatory user interface. We are thinking in innovative ways to combine the available technologies and ideas to an edgeless package. Visit wtechportal.com to get more information about the newest features integrated into [w]tech!
Technique for simulating glass, water and other transparent material is now available in [w]tech
Posted by unrealer2 on Feb 10th, 2011
When you look through water on the ground it is distorted. In [w]tech we are now able to simulate this with a technique called "Refraction", discribed in GPU Gems 2.
You cannot read and write on a rendertarget at the same time, this is why we have to use two of them: We render the whole scene to our first one, then the second one is used to render all meshes with a refractive shader. Therefore the first rendertarget is filled at first and is then able to give its information to the second rendering pass. After the second rendertarget is filled and all refractive meshes are rendered, both rendertargets are blended together to the final scene.
The first animation shows a flat shaded mesh with a refraction shader. We use a kind of refraction technique which uses the normals of the rendered mesh to distort the background.
At the moment neither lit nor a overlapping of multiple transparent meshes is rendered correctly, but we will find a way to simulate this as well.
The second animation shows a smooth shaded mesh. In fact, there is a big difference in the way it looks like. With flat shaded meshes you can simulate diamonds or glass in general.
When you want to create water you can use a smooth shaded mesh to have correct distortion.
In addition to that, you are able to use a normal map to add further details to the surface.
Here is a screenshot of our testmap with the figure rendered with a refractive figure:
For more information visit: Wtechportal.com