Computer Graphics II: Fishtank

Yet another Fishtank
Computer Graphics II
Summer term 2009
Philip Wette
Nico Bredenbals
Niroshan Thillainathan
1
The Setting
Ship transporting a fishtank
on the ocean
WASD-Controlled „fly-mode“
Editor: everything in the scene can be moved by keyboard
Over- and Underwater perspective
Objects, Lights and Object behaviour loaded from text-file
Recursive World:
the fishtank contains a portal to the outer world
2
Realistic Water Surface
Three-pass rendered water surface
With per pixel blending
and specular highlights
3
The techniques used to create the Water
Water: Implemented as a perfect mirror
Ripples and disturbation added by a normal-map:
Take the perfect mirror's texture coordinates and add the x and y
coordinates of a normal vector from the normal-map
Make the water surface opaque:
The refraction and reflection textures are blended onto another
depending on the view-angle per pixel in the fragment-shader
4
Underwater Caustics
Done by projective texturing
Normal-mapping for the movements of the light beams
5
Recursive World
If the Boundingbox of the small ship is entered the aquivalent
Position of the big ship's Boundingbox is calculated and the
camera is translated to there
6
The Fish
Every fish can have
Its own velocity
Fish swim inside
user defined
Boundingboxes
If fish swim out of a boundingbox they change direction
The Fish and the seagrass are animated by a vertex shader
7
Other techniques used
Particle System for
air bubbles
Bump mapping for the
seabed
Phong per pixel shading
Alpha blending and sorting
Bloom shader based on gausian blur to create the feeling of beeing
dazzled by the light
Mooving Skydome
Fog
8
The reason why there are no shadows
We tryed to implement shader driven stencil shadows
This technique uses shadow boxes and the stencil buffer:
Shadow boxes are computed by the vertex shader
Front- and Backface-Culling is beeing used to determine if a shadow
has to be drawn on an object
Therefore the scene is rendered in two passes into the stencil buffer
and afterwards the stencil buffer is copied to a texture
We had partial success in drawing shadows in an own scene
with a special 3D-model but there was not enough time / to
many problems to port the shadows in our fishtank scene
9
Resources
Water Surface: http://www.riemers.net
Stencil Shadows: Paper by John Carmack and Nvidia
(http://developer.nvidia.com/object/robust_shadow_volumes.html)
General:
http://www.gamedev.net/
http://jerome.jouvie.free.fr/OpenGl/
10