bmap_to_cubemap( BMAP*)

Converts a six-sided sky cube bitmap into a cubic environment map, which can be used for enviroment mapping or shader effects.

Parameters:

BMAP* - pointer to sky cube bitmap

Remarks:

Speed:

Slow

Edition:

 C   P 

Example:


BMAP* bmpEnviro = "skybox+6.tga";

MATERIAL* mtlEnviro =
{
   skin2 = bmpEnviro;
   effect = "
      texture mtlSkin2;
      technique enviro
      {
         pass P0
         {
            Texture[0] = <mtlSkin2>;
            AddressU[0] = Clamp; // don't wrap around edges
            AddressV[0] = Clamp;
            ColorOp[0] = SelectArg1; // ignore the ambient light
            ColorArg1[0] = Texture;
            TexCoordIndex[0] = CameraSpaceReflectionVector;
            TextureTransformFlags[0] = Count3;
         }
      }

      technique fallback { pass p0 { } } // empty fallback causes normal rendering without effect
   ";
}

function mtlEnviro_startup()
{
   bmap_to_cubemap(mtlEnviro.skin2);
}

See also:

CUBE, view.bmap

► latest version online