Water Clipping
Question submitted by (06 January 2000)




Return to The Archives
 
  When swimming around in Unreal Tournament, and when you swim close to the water line, you dont get the usual clipping problem so that the water gets clipped near the camera. So i was wondering... what should i do if i want the same effect??? Im using openGL of course :-)  
 

 
  Well, if I was to guess I'd say that they are tracking which water triangles intersect the near clip plane and then drawing alpha blended triangles on the near clip plane below the water line. Since the Unreal engine does all of its own transforms and clipping it should be relatively simple for them to track which water triangles intersect the near clip plane and generate the new vertices every frame. If you're using OpenGL or D3D's transforms then you will want to take a pass through the water geometry, find where it intersects the near clip plane, and then use that to draw the triangles.



Response provided by Tom Hubina
 
 

This article was originally an entry in flipCode's Fountain of Knowledge, an open Question and Answer column that no longer exists.


 

Copyright 1999-2008 (C) FLIPCODE.COM and/or the original content author(s). All rights reserved.
Please read our Terms, Conditions, and Privacy information.