Papervision 3D Programming Tutorial - Environment Mapping

Posted Feb 11, 2009 by mcasperson / comments 0 comments / Print / Font Size Decrease font size Increase font size

Learn how to implement environment mapping with Papervision.

VIEW THE DEMO
DOWNLOAD THE CODE

Yesterday I showed you a Papervision application that displayed 3D text, which could then be rotated and interacted with as you would any other Papervision object. I mentioned that some of the inspiration for that app came from the Windows “3D Text” screensaver. There was one big difference though: the screensaver displays shiny, reflective letters, whereas my app only had a solid colour.

The shiny look that you see in the Windows screensaver is achieved  through a process known as environment mapping. Essentially it fakes the look of a reflective surface. Even with today’s hardware, doing proper, ray traced reflections can not be done in real time. With environment mapping a model is rendered as if the camera were looking at a reflection of the static texture. It is quick, and quite effective, although not actually a true reflection of the surrounding environment.

Papervision supports environment maps through the EnvMapMaterial class. You supply a light point, and environment map texture and an ambient colour to the EnvMapMaterial constructor, and from then on just use the EnvMapMaterial like it was any other material.

If you download the source you’ll find the EnvMapMaterial class created in the ResourceManager, and then assigned to a standard MeshObject class just like it was a MovieMaterial or some other standard Papervision material.

Go back to Papervision Tutorials

Check out these other Papervision examples:

Loading and Displaying a 3D Model

Particle Systems with Flint

Modify Textures At Runtime

WOW Physics

Shading

Effects

Animated Textures

Mouse Selection

Texture Smoothing

Transparency

Animations

SkyBox

Environment Mapping

3D Text

BitmapViewport

3D Spectrum Analyser

Depth of Field

Casting Shadows

Photo Cloud

Photo Slide

Rate this Article:

Be the first to rate me.


* You must be logged in order to leave comments, please login or join us.

Comments

No comments yet.



Bookmark and Share
Sign up for our email newsletter
Name:
Email: