Docsity

Lecture Slides on Texture Mapping Application | CS 470, Study notes of Computer Graphics

Partial preview of the text

Download Lecture Slides on Texture Mapping Application | CS 470 and more Study notes Computer Graphics in PDF only on Docsity!

Computer Graphics

CS 470

Computer Science and Electrical Engineering Dept.

West Virginia University

6th November 2006

Outline

1 Texture Mapping Applications

Texture Mapping Applications The Sky Cube

Sky Cube (or Sky Box)

In a real scene, there is incoming light from all directions.

Outdoors this light may be coming from very far away.

To simulate this : place a textured box around the camera position.

Texture the box with an image of the environment.

In out door scenes, the image is the sky and far away terrain.

The texture images applied to 5 or 6 sides of a cube:

Sky cube textures.

Texture Mapping Applications The Sky Cube

Sky Cube (or Sky Box)

Draw sky cube before anything else.

I Can eliminate color buffer clearing.

The sky won’t occlude anything else in the scene

I Disable depth writes: glDepthMask(GL_FALSE);

I Disable depth test.

Always centered at camera position.

I Get modelview matrix - zero the translation.

Disable lighting, don’t send normals.

The bottom face of the cube is not needed if there is a ground plane or

terrain in the scene.

Texture Mapping Applications Terrain

Terrain using heightmaps

Textured terrain and sky box.

Texture Mapping Applications Terrain

Terrain challenges

May not have data at regular grid points.

Terrain may be huge : LOD schemes

Lighting : can be done as a preprocessing step

Texture Mapping Applications Water

Refraction : Snell’s law

n 1 sin(θ 1 ) = n 2 sin(θ 2 )

Refraction is usually computed on the GPU as a texture lookup operation.

Texture Mapping Applications Water

Reflection : The Fresnel effect

Fraction of light reflected depends on the angle of incidence.

Texture Mapping Applications Water

Reflection : Cube mapping

The cube map images can be low

resolution version of the sky cube

images.

Cube mapping results.

Texture Mapping Applications Billboards

Billboards

Always appear to face the camera

Can construct billboards be extracting look, right and up vectors from the

camera view matrix.

Several variations:

View-plane aligned

View-point aligned

Spherical

Cylindrical

Texture Mapping Applications Particles

Particles

Many physical phenomena are not well-represented by triangle meshes.

Fire, smoke.

Liquid splashes and sprays.

Explosions, sparks, fireworks

These things do not have well-defined boundaries, and evolve over time.

Texture Mapping Applications Particles

Particle Systems

Implemented as animated billboards.

Physically based motion

Billboard size may change

Texture animation may be used

Usually alpha blended