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

Convert height map to normal map. More...

#include <ProceduralTextureModifiers.h>

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

Public Member Functions

 Normals (TextureBufferPtr pBuffer)
 Default constructor. More...
 
NormalssetAmplify (Ogre::uchar amplify)
 Set amplify for normal calculation. 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

Convert height map to normal map.

Use Sobel algorithm to calculate a normal map out of the given image.

Example:

dot_texture_21a.png

Tip
Create a copy of your working TextureBuffer for normal mapping before you colour it:
// Generate structure
Procedural::TextureBuffer bufferColour(256);
// Create normal map
Procedural::TextureBufferPtr bufferNormalMap = bufferColour.clone();
Procedural::Normals(bufferNormalMap).process();
// Colourize structure
delete bufferNormalMap;
dot_texture_21b.png

Constructor & Destructor Documentation

◆ Normals()

Procedural::Normals::Normals ( 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::Normals::process ( )
virtual

Run image manipulation.

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

Implements Procedural::TextureProcessing.

◆ setAmplify()

Normals& Procedural::Normals::setAmplify ( Ogre::uchar  amplify)

Set amplify for normal calculation.

Parameters
amplifyNew amplify for calculation (default 64)

◆ setLog()

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

Enable/Disable logging.

Parameters
enabletrue enables logging of filter actions

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.
Ogre::ColourValue::Red
static const ColourValue Red
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.
Ogre::ColourValue::Blue
static const ColourValue Blue
Procedural::Colours::setColourPercent
Colours & setColourPercent(Ogre::ColourValue colour)
Set the percent colour to add on image.
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::Colours::setColourBase
Colours & setColourBase(Ogre::ColourValue colour)
Set the base colour to work on.
Procedural::Normals::process
TextureBufferPtr process()
Run image manipulation.
Procedural::Colours::process
TextureBufferPtr process()
Run image manipulation.
Procedural::Colours
A colour filter.
Definition: ProceduralTextureModifiers.h:664