Ogre Procedural  0.3.0 unstable
Procedural Geometry & Textures for Ogre3D
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Procedural::TextureLightBaker Class Reference

Apply an illumination on a surface. More...

#include <ProceduralTextureModifiers.h>

Inheritance diagram for Procedural::TextureLightBaker:
Inheritance graph
[legend]

Public Member Functions

 TextureLightBaker (TextureBufferPtr pBuffer)
 Default constructor. More...
 
TextureLightBakersetNormalMap (TextureBufferPtr normal)
 Set parameter image for compensation. More...
 
TextureLightBakersetColourAmbient (Ogre::ColourValue colour)
 Set the ambient light colour. More...
 
TextureLightBakersetColourAmbient (Ogre::Real red, Ogre::Real green, Ogre::Real blue, Ogre::Real alpha=1.0f)
 Set the ambient light colour. More...
 
TextureLightBakersetColourDiffuse (Ogre::ColourValue colour)
 Set the diffuse light colour. More...
 
TextureLightBakersetColourDiffuse (Ogre::Real red, Ogre::Real green, Ogre::Real blue, Ogre::Real alpha=1.0f)
 Set the diffuse light colour. More...
 
TextureLightBakersetColourSpecular (Ogre::ColourValue colour)
 Set the specular light colour. More...
 
TextureLightBakersetColourSpecular (Ogre::Real red, Ogre::Real green, Ogre::Real blue, Ogre::Real alpha=1.0f)
 Set the specular light colour. More...
 
TextureLightBakersetColours (Ogre::ColourValue ambient, Ogre::ColourValue diffuse, Ogre::ColourValue specular)
 Set the light colours. More...
 
TextureLightBakersetPosition (Ogre::Vector3 position)
 Set the position of light on/over the image. More...
 
TextureLightBakersetPosition (Ogre::Real x, Ogre::Real y, Ogre::Real z)
 Set the position of light on/over the image. More...
 
TextureLightBakersetSpecularPower (Ogre::uchar power)
 Set specular light power. More...
 
TextureLightBakersetBumpPower (Ogre::uchar power)
 Set bump mapping power. More...
 
TextureBufferPtr process ()
 Run image manipulation. More...
 
Ogre::String getName ()
 Get name of the filter as string. More...
 
void setLog (bool enable=true)
 Enable/Disable logging. More...
 

Protected Member Functions

void logMsg (Ogre::String msg)
 

Protected Attributes

TextureBufferPtr mBuffer
 
Ogre::String mName
 
bool mLog
 

Detailed Description

Apply an illumination on a surface.

The parameter image is the required normal map. You can also set ambient, diffuse and specular light with different colors and intensity.

Example:

// Generate structure
Procedural::TextureBuffer bufferCell(256);
// Create normal map
Procedural::TextureBufferPtr bufferNormalMap = bufferColour.clone();
Procedural::Normals(bufferNormalMap).process();
Procedural::Light(&bufferCell).setNormalMap(bufferNormalMap).setColourAmbient(127, 60, 0, 0).setColourDiffuse(60, 25, 0, 0).setBumpPower(255).process();
delete bufferNormalMap;

dot_texture_19a.png

Note
If you don't set the normal map a clone of the base input image will be used as normal map with Normals filter.
dot_texture_19b.png

Constructor & Destructor Documentation

◆ TextureLightBaker()

Procedural::TextureLightBaker::TextureLightBaker ( TextureBufferPtr  pBuffer)

Default constructor.

Parameters
pBufferImage buffer where to modify the image.

Member Function Documentation

◆ getName()

Ogre::String Procedural::TextureProcessing::getName ( )
inherited

Get name of the filter as string.

◆ logMsg()

void Procedural::TextureProcessing::logMsg ( Ogre::String  msg)
protectedinherited

◆ process()

TextureBufferPtr Procedural::TextureLightBaker::process ( )
virtual

Run image manipulation.

Returns
Pointer to image buffer which has been set in the constructor.

Implements Procedural::TextureProcessing.

◆ setBumpPower()

TextureLightBaker& Procedural::TextureLightBaker::setBumpPower ( Ogre::uchar  power)

Set bump mapping power.

Parameters
powerNew power value for bump mapping (default 0)

◆ setColourAmbient() [1/2]

TextureLightBaker& Procedural::TextureLightBaker::setColourAmbient ( Ogre::ColourValue  colour)

Set the ambient light colour.

Parameters
colourNew ambient light colour (default Ogre::ColourValue::Black)

◆ setColourAmbient() [2/2]

TextureLightBaker& Procedural::TextureLightBaker::setColourAmbient ( Ogre::Real  red,
Ogre::Real  green,
Ogre::Real  blue,
Ogre::Real  alpha = 1.0f 
)

Set the ambient light colour.

Parameters
redRed value of ambient light colour [0.0, 1.0] (default 0.0)
greenGreen value of ambient light colour [0.0, 1.0] (default 0.0)
blueBlue value of ambient light colour [0.0, 1.0] (default 0.0)
alphaAlpha value of ambient light colour [0.0, 1.0] (default 0.0)

◆ setColourDiffuse() [1/2]

TextureLightBaker& Procedural::TextureLightBaker::setColourDiffuse ( Ogre::ColourValue  colour)

Set the diffuse light colour.

Parameters
colourNew diffuse light colour (default Ogre::ColourValue(0.5f, 0.5f, 0.5f, 1.0f))

◆ setColourDiffuse() [2/2]

TextureLightBaker& Procedural::TextureLightBaker::setColourDiffuse ( Ogre::Real  red,
Ogre::Real  green,
Ogre::Real  blue,
Ogre::Real  alpha = 1.0f 
)

Set the diffuse light colour.

Parameters
redRed value of diffuse light colour [0.0, 1.0] (default 0.5)
greenGreen value of diffuse light colour [0.0, 1.0] (default 0.5)
blueBlue value of diffuse light colour [0.0, 1.0] (default 0.5)
alphaAlpha value of diffuse light colour [0.0, 1.0] (default 1.0)

◆ setColours()

TextureLightBaker& Procedural::TextureLightBaker::setColours ( Ogre::ColourValue  ambient,
Ogre::ColourValue  diffuse,
Ogre::ColourValue  specular 
)

Set the light colours.

Parameters
ambientNew ambient light colour (default Ogre::ColourValue::Black)
diffuseNew diffuse light colour (default Ogre::ColourValue(0.5f, 0.5f, 0.5f, 1.0f))
specularNew specular light colour (default Ogre::ColourValue::White)

◆ setColourSpecular() [1/2]

TextureLightBaker& Procedural::TextureLightBaker::setColourSpecular ( Ogre::ColourValue  colour)

Set the specular light colour.

Parameters
colourNew specular light colour (default Ogre::ColourValue::White)

◆ setColourSpecular() [2/2]

TextureLightBaker& Procedural::TextureLightBaker::setColourSpecular ( Ogre::Real  red,
Ogre::Real  green,
Ogre::Real  blue,
Ogre::Real  alpha = 1.0f 
)

Set the specular light colour.

Parameters
redRed value of specular light colour [0.0, 1.0] (default 1.0)
greenGreen value of specular light colour [0.0, 1.0] (default 1.0)
blueBlue value of specular light colour [0.0, 1.0] (default 1.0)
alphaAlpha value of specular light colour [0.0, 1.0] (default 1.0)

◆ setLog()

void Procedural::TextureProcessing::setLog ( bool  enable = true)
inherited

Enable/Disable logging.

Parameters
enabletrue enables logging of filter actions

◆ setNormalMap()

TextureLightBaker& Procedural::TextureLightBaker::setNormalMap ( TextureBufferPtr  normal)

Set parameter image for compensation.

Parameters
normalPointer to an normal map image (default NULL)
Note
If the parameter normal is set to NULL a clone of the base input image will be used as normal map with Normals filter.

◆ setPosition() [1/2]

TextureLightBaker& Procedural::TextureLightBaker::setPosition ( Ogre::Real  x,
Ogre::Real  y,
Ogre::Real  z 
)

Set the position of light on/over the image.

Parameters
xNew light position on x axis (default 255.0f)
yNew light position on y axis (default 255.0f)
zNew light position on z axis (default 127.0f)

◆ setPosition() [2/2]

TextureLightBaker& Procedural::TextureLightBaker::setPosition ( Ogre::Vector3  position)

Set the position of light on/over the image.

Parameters
positionNew light position (default Ogre::Vector3(255.0f, 255.0f, 127.0f))

◆ setSpecularPower()

TextureLightBaker& Procedural::TextureLightBaker::setSpecularPower ( Ogre::uchar  power)

Set specular light power.

Parameters
powerNew power value for specular light (default 0)

Member Data Documentation

◆ mBuffer

TextureBufferPtr Procedural::TextureProcessing::mBuffer
protectedinherited

◆ mLog

bool Procedural::TextureProcessing::mLog
protectedinherited

◆ mName

Ogre::String Procedural::TextureProcessing::mName
protectedinherited

The documentation for this class was generated from the following file:
Procedural::Cell::setDensity
Cell & setDensity(Ogre::uint density)
Set the density of cells in texture.
Procedural::Normals
Convert height map to normal map.
Definition: ProceduralTextureModifiers.h:2031
Procedural::Cell::setRegularity
Cell & setRegularity(Ogre::uchar regularity)
Set the regularity of texture.
Procedural::Cell
Create a texture consisting of cells aligned in a grid, or a chessboard.
Definition: ProceduralTextureGenerator.h:71
Procedural::Cell::process
TextureBufferPtr process()
Run image generation.
Procedural::TextureBuffer::clone
TextureBufferPtr clone() const
Create a copy of the current texture image buffer.
Procedural::TextureBuffer
class to store image data while processing
Definition: ProceduralTextureBuffer.h:50
Procedural::Normals::process
TextureBufferPtr process()
Run image manipulation.