C3DMesh::BeginRenderCubeTexture

Top  Previous  Next

Syntax:

 

BeginRenderCubeTexture(int  texNum, int  side, float  x, float  y, float  z)

 

Purpose:

Sets the render target of Direct3D to the cubic environment texture contained in this mesh object.

 

Parameters:

texNum - The texture number.

side - Which side of the texture should be used as the render target.

x, y, z - The position of the camera used to render the cube map.

 

Returned value(s):

None

 

Application:

'render a static cubemap
for  x = 0 to 5
  sphere.BeginRenderCubeTexture(0,x,0,0,0)
  s.Clear(RGBA(0,0,255,255))
  room.Draw()
  sphere.EndRenderCubeTexture()
next x        

 

Class Hierarchy

C3DObject

-------C3DMesh

 

Additional Info:

Cubic environment maps sometimes referred to as cube maps are textures that contain image data representing the scene surrounding an object, as if the object were in the center of a cube. Each face of the cubic environment map covers a 90-degree field of view in the horizontal and vertical, and there are six faces ,or sides, per cube map.

 

After calling this command the cube map is selected as the render target and the side specified becomes the surface on which all objects are drawn. Draw your scene to each of the six sides of the cube map in an identical manner you would if rendering to the primary surface. You should hide the object containing the cube map texture before rendering using the SetVisible method.

 

Rendering a cubic environment texture is time consuming since 6 separate copies of your scene must be rendered.  It is more efficient to use a static cube map than a dynamic one for complex scenes.

 

Unlike drawing a normal scene with C3DScreen::BeginScene, the C3DScreen::Clear command should be used after BeginRenderCubeTexture

 

See Also:

EndRenderCubeTexture