Reference no: EM132410693
Procedural Landscape Generation -
You will use procedural methods to generate a virtual landscapes. The project can be divided into the following three parts.
- geometry (mesh generation, procedural height generation)
- rendering (terrain shading, texturing)
- animation (camera animation)
Each of these parts are subdivided into basic and advanced tasks.
Geometry
- create a flat (z=0) triangular mesh. Do so using GL_TRIANGLE STRIP, making use of GL_PRIMITIVE RESTART
- implement Perlin noise on the CPU (see noise.h)
- generate a height map texture using fBm (read this tutorial on fractional Brownian motion)
- use the height map texture to displace grid vertices in the vertex shader
Advanced
- implement noise texture generation in the fragment shader
- implement other noise functions to generate terrain (e.g. hybrid multifractal and ridged multifractal)
- instead of generating a plane world, create a spherical world
- create an infinite world (new tiles on demand, requires GPU noise)
- use L-system to add trees to your terrain
- use noise functions to generate clouds (and integrate participating media in fshader)
Rendering
- calculate surface normals, add diffuse and specular shading.
- use the tile-able textures (shown above) to texture your terrain. In the fshader you can use the normal of a fragment (slope of terrain) and its height to decide which textures to blend. For example, snow does not deposit on very steep slopes, and happens only at a certain height. (Download *.png: grass, rock, sand, snow, water)
- implement the skybox texture using OpenGLs cubemap textures. Surround your scene with a cube, and texture this cube to color the sky of your scene. Under Textures folder, you can find miramar_*.png which may be used to create the skybox. You will have to write UV texture coordinates in your C++ code so as to map faces of the cube to the correct portion of the image/texture (reference).
Advanced -
use an OpenGL CubeMap to texture the sky and get rid of artifacts caused by discontinuities in the UV parameterization.
use the normal map texture (water.png) to represent waves. You can overlap multiple scaled copies of this texture and translate them over time to emulate a water effect.
add a mirroring eect to the water; this is achieved by mirroring the camera position with respect to the water plane, render your scene in a framebuffer, and placing the texture back in a second step. You can also simulate refraction by blending the mirrored and non-mirrored images according to the incidence angle of your camera w.r.t. water
simulate the fact that reflections are affected by water movement by distorting the reflected image with a noise function
Animation -
- implement WASD (forward/backward, left/right) camera controls
Advanced
- use a bezier curve to animate the camera path (5%)
- implement a FPS camera, camera height is determined by terrain height (5%)
- use a displacement map to animate waves; the map can be computed numerically as a sum of periodic functions varying over time (10%)
- use particles and billboards to animate 3D snow
Getting Started -
The starter code is filled with TODO comments. The following order of completion is recommended:
- genTerrainMesh() in main.cpp
- drawTerrain() in main.cpp
- lerp(), perlin2D(), and fBm2DTexture in noise.h
- terrain vshader.glsl
- drawSkybox() in main.cpp
- KeyEvent listener callback in main.cpp
- terrain fshader.glsl
Attachment:- Assignment File.rar