Difference between revisions of "Project6SP15"
From Immersive Visualization Lab Wiki
Line 35: | Line 35: | ||
* We provide a [[Media:shader-class.zip|sample shader class]] and [[Media:shaders.zip|three sample combinations of vertex and fragment shaders]] for you to familiarize yourself with GLSL shader programming more, if you find additional examples to the code on Lighthouse3D to be useful. | * We provide a [[Media:shader-class.zip|sample shader class]] and [[Media:shaders.zip|three sample combinations of vertex and fragment shaders]] for you to familiarize yourself with GLSL shader programming more, if you find additional examples to the code on Lighthouse3D to be useful. | ||
* The Lighthouse3D example assumes that your spot light is your first light (light #0), so if your spot light is actually light #1 you need to change that in the shader. | * The Lighthouse3D example assumes that your spot light is your first light (light #0), so if your spot light is actually light #1 you need to change that in the shader. | ||
+ | |||
+ | ==3. Optional Project: Height Map (10 points)== | ||
+ | |||
+ | Generate and display a 3D mesh out of a 2D height map image. Wikipedia has a great [http://en.wikipedia.org/wiki/Heightmap description of this topic]. Allow the user to interactively fly over the height map, similar to a simple flight simulator. You can use the height map image from the Wikipedia page, which you will also find below, or create your own with a paint program or another method of your choice. | ||
+ | |||
+ | <center> | ||
+ | [[Image:Heightmap.png]]<br> | ||
+ | ''Height map image from Wikipedia'' | ||
+ | </center> | ||
+ | |||
+ | To get full credit you need to implement the following features: | ||
+ | |||
+ | * Load the height map image and create a 3D mesh out of it. You can either read the Wikipedia PNG image file with your own reader, or read [[Media:Heightmap.pgm|this PGM image file]] with [[pgm-loader.cpp|this piece of C code]]. Note that this code returns a one dimensional array, which you have to interpret as a two-dimensional array based on the width of the image. Add the mesh to your 3D viewer and allow switching to it with the 'F8' key ('F7' is for the soccer ball if you have it). ('''5 points''') | ||
+ | |||
+ | * Color the terrain polygons in blue (water), yellow (sand), green (grass), grey (rock) or white (snow), depending on their height. Feel free to add more colors as you see fit. ('''2 points'''). | ||
+ | |||
+ | * Add support for an airplane flight mode, in which the user can use the cursor keys to rotate the camera left or right and tilt it up or down, and change the velocity of the flight ('-' for slower, '=' for faster) ('''3 points'''). | ||
+ | |||
+ | If you use the Wikipedia height map, the resulting terrain should look similar to this, except that it needs to be colored as described above: | ||
+ | |||
+ | <center> | ||
+ | [[Image:Heightmap_rendered.png]]<br> | ||
+ | ''3D terrain generated from height map'' | ||
+ | </center> | ||
+ | |||
--> | --> |
Revision as of 19:51, 8 May 2015
Project 6: Terrain Shaders
In this project you will need to render a terrain with a GLSL shader program.
This project is due on Friday, May 15th, 2015 at 1:00pm. You need to present your results in the CSE basement labs as usual, grading starts at 12:15pm. Please upload your source code including your shaders to the Ted system by 1pm. You do not need to upload any binaries, including textures, 3D models, etc.
The discussion for this project will be on Monday, May 11th.
The total score for this project is 100 points, plus 10 for extra credit.