Mel Script - Environment Maps [API]

 


Sphere Map

 

 

 

Environment mapping within Computer Graphics is often used to add reflections to certain objects within the scene. Within Maya we have 2 basic types, Sphere mapping and Cube mapping.

Both techniques rely on the automatic generation of texture co-ordinates to choose which portion of a texture to apply to the surface. Sphere maps use a single texture mapped onto a sphere, whereas cube maps use 6 textures mapped onto the surface of a cube. For each vertex to be shaded, a ray is cast to the center of the sphere or cube, and the intersection point on that surface determines which portion of the texture to use.

It is for this reason that all Environment maps are connected to a place3dTexture node (basically just a transform node). Moving the place3dTexture node around changes the center point and orientation of the geometry used to calculate the environment map.

All environment maps are connected to the reflectedColor attribute of the materials they affect.

 

 

 


Cube Map

 

 

Creating a Sphere Map