Description

A demonstration of an explorable underwater scene implemented in OpenGL.

Controls

Features

Blinn-Phong Lighting

Blinn-Phong Lighting employs the fragment shader to calculate the necessary color for each fragment. By providing a light source and the object's coefficients for ambient, diffuse and specular lighting, we are able to simulate how light reflects a given surface.

Hierarchical Modeling

Hierarchical modeling allows us to move shapes around with respect to an arbitrary frame. This makes it less difficult to implement translations and rotations around joints.

Camera Control

The camera is fixed on the ocean floor and allows the user to walk and look around using the standard WASD keys and mouse pointer, similar to most first person interactive 3D games.

Textures

Texture mapping allows the object meshes to be wrapped using selected image files. In addition to Blinn-Phong lighting, textures add more realism to an object.

Cubemap

Also referred to as a skybox, a cubemap renders a 3D cube that the camera is wrapped around in. By removing the camera translation and keeping the view matrix, the cubemap will only move with respect to the mouse pointer, without the WASD keys. The textures mapped on the cube appear to be seamless and look infinitely far away because of how it ignores the camera translation.


Water Caustics

In order to simulate the reflection and refraction of light on the ocean surface, a periodic caustic texture was used and applied to the ocean floor. By mapping the caustic texture onto the surface and rendering using the fragment shader, periodic water caustics are simulated.


Resources