Authors: Jarrett Tierney, Dustin Rhodes

Email: jtierney@ucsc.edu, dcrhodes@ucsc.edu

Multi-Channel height maps



GOAL:

The goal of this part of the project is to create a single image file that contains more than just a simple height map. The multi-channel height map file will contain different placement maps in each of the channels. The channel split is as follows:



alpha: height map

red: fire/particles

blue: water

green: fog

Thus both the terrain generator and the particle engine will pull from multi-channel height map. The terrain generator will feed the particle engine positioning info based on the terrain coordinates to allow for proper placement. (preventing a particle emitter inside a mountain)



Initial Image (alpha height map channel not displayed):

























Final Image:







Video Download Link
Source Download Link





Terrain Generator (Terrain.cpp Terain.h)



      1. to generate a terrain based off a given height map

      2. dynamically place water features into the terrain

The terrain engine will utilize the height map in the alpha channel of the image to generate the terrain itself. (where white means high Y value and black means low Y value). The terrain generator will then perform a second pass using the blue channel from the image to place and create water features. The water features are texture mapped using an externally loaded image.

Particle Generator (Emitter.cpp Emitter.h)

The goal of the particle generator is to create a relatively flexible particle generator capable of creating both fire and fog. The particles are emitted from a plane defined as 4 points. These planes are the same planes used by the terrain generator so we know that the particles are placed on the surface of the land. Additive blending is used for this part of the rendering and depth sort is turned off here so that sorting doesn't need to be done on the large number of particles.

The terrain map would then be read in the red and green channel and particle generators would be produced at the appropriate locations (x,y) based off of red/green values. The plane at which to place the generators would be passed in by the terrain generator.

The two emitters for fire and fog are very similar but have different particle sizes and update functions.

The particles are drawn as points so that they will always be facing the camera. Antialiasing is turned on and the z depth (compared to the camera) is calculated and used as the size of the particles to maintain the perspective look.



Image Reader (Image.cpp Image.h)

Reads in an image from a file passed in on initialisation. This image can then be used as a texture or to fill an array with the red, green, blue or alpha channels of the image. It's texture mapping functionality is used in the land and water features while it's channel reading is used to generate the terrain and emitters

Task Breakdown:

Jarrett Tierney: Terrain Generator, multi-channel map (alpha and blue)

Dustin Rhodes: Particle Engine, multi-channel map (red and green)

Milestones:



Milestone 1: Multi-Channel Map implemented

Read in an image, separate out rgba values, store values in data structure

Milestone 2: Terrain Generator and Particle Engine implemented

Generate terrain based on the alpha properties of the image

Be able to generate fire/cloud effects in isolation but do not place them onto the map

Milestone 3: Water Features, Particle Emitter placement

Generate water on the map from the blue portion of the image

Place the Generators for fire and fog on the map in the appropriate locations

Milestone 4: Read in image files to create textures for water and land

Alter the blending functions and make particles billboarded