Lab 6: Fractal Landscape
CS 445: Computer Graphics, Fall 2017


Due Date: be ready to demo at the beginning of lab Wednesday, Oct 25

Goals

You are to work alone for this lab.

In this lab you are given a digital elevation model (DEM) which consists of a 2D grid of height values. Your job is to convert the DEM to a surface (triangles/vertices), compute the normals for each vertex and, in the fragment shader, implement a color ramp which generates the color of each fragment based on the height (y value in object coordinates) of the vertex.

In part 1 you can just set the color based on the uniform color. In part 2, you will write a color ramp method in the Javascript code to compute the vertex color based on the height of the vertex. In part 3, you will implement the color ramp directly in the fragment shader.

Directions

Part 1:

Part 2: Next, you are to switch to vertex colors and set the colors based on the height (y-value) of the landscape:

Part 3: The vertex colors don't look great because of how they are interpolated across triangles. You can see this better in the closeup on the right above. For this reason, you are now to move the color computation to the fragment shader.

To Hand In

By the beginning of lab on the due date above, be ready to demonstrate your finished program. The scene should show your fractal landscape with a light source that can be moved around. The landscape should have a realistic looking color ramp (e.g. blue for water, white for snow peaks, etc) implemented in the fragment shader.

Then submit your code to WISE: