My Project
Public Member Functions | List of all members
ParaTerrain::DetailTexture Class Reference

A DetailTexture is a "layer" that can be painted onto to put texture "splats" on a terrain surface. More...

#include <DetailTexture.h>

Public Member Functions

 DetailTexture (Texture *pTexture, Texture *pMask)
 Constructs a new DetailTexture that allows splatting of the specified Texture as a detail texture.
 
 DetailTexture (Texture *pTexture=NULL, byte DefaultMaskValue=0)
 
 DetailTexture (CParaFile &file, Terrain *pTerrain)
 
void SetMask (Texture *)
 Sets the alpha mask to be used for this painting layer. This should be an alpha-only Texture.
 
void SetTexture (Texture *)
 Sets the Texture that this painting layer uses as a detail texture.
 
DeviceTexturePtr_type BindMask ()
 Binds the mask layer to an OpenGL texture object.
 
DeviceTexturePtr_type BindTexture ()
 Binds the detail texture to an OpenGL texture object.
 
void Unbind ()
 Unloads both the mask and detail OpenGL texture objects.
 
TextureGetMask ()
 Gets the alpha mask layer.
 
TextureRegenerateMask (byte DefaultMaskValue=0xff)
 regenerate the Mask file based on the dimension of the detailed texture. More...
 
TextureGetTexture ()
 Gets the detail texture.
 
void WriteMask (CParaFile &file, Terrain *pTerrain)
 
void ReadMask (CParaFile &file, Terrain *pTerrain)
 
void FlipVertical ()
 Works exactly like Texture::FlipVertical().
 
void FlipHorizontal ()
 Works exactly like Texture::FlipHorizontal().
 
bool IsOwnMask ()
 
void SetOwnMask (bool bOwn)
 
bool IsOwnTexture ()
 
void SetOwnTexture (bool bOwn)
 

Detailed Description

A DetailTexture is a "layer" that can be painted onto to put texture "splats" on a terrain surface.

You should rarely need to use this class directly. Demeter uses it to manage alpha blending of detail textures onto the terrain surface. There is one instance of this class for each texture "cell" in a Terrain. The number texture cells in a Terrain is set in one of two ways: (the size of the overall terrain texture / 256) ^ 2, OR by what you specify in a call to Terrain::AllocateTextureCells().

Member Function Documentation

§ RegenerateMask()

Texture * DetailTexture::RegenerateMask ( byte  DefaultMaskValue = 0xff)

regenerate the Mask file based on the dimension of the detailed texture.

This function is usually called, when the mask file of the texture is not created so far.

Parameters
DefaultMaskValuethe pixel color of the mask.
Returns
: the mask file is returned.

The documentation for this class was generated from the following files: