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

Create lines that can be randomly cracked or follow a normal map. More...

#include <ProceduralTextureModifiers.h>

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

Public Types

enum  CRACK_LENGTH_DECISION { LENGTH_DECISION_RANDOM, LENGTH_DECISION_CONSTANT, LENGTH_DECISION_NORMAL_BASED }
 Methods how to create line length. More...
 
enum  CRACK_QUALITY { QUALITY_HIGH_OFF, QUALITY_ALPHA, QUALITY_SUBPIXEL }
 High quality settings. More...
 

Public Member Functions

 Crack (TextureBufferPtr pBuffer)
 Default constructor. More...
 
CracksetParameterImage (TextureBufferPtr image)
 Set parameter image for normal mapping. More...
 
CracksetColour (Ogre::ColourValue colour)
 Set the colour to draw. More...
 
CracksetColour (Ogre::Real red, Ogre::Real green, Ogre::Real blue, Ogre::Real alpha=1.0f)
 Set the colour to draw. More...
 
CracksetCount (Ogre::uint count)
 Set the number of generated lines. More...
 
CracksetVariation (Ogre::uchar variation)
 Set the smoothness of generated lines. More...
 
CracksetLength (Ogre::uchar length)
 Set the minimum length of generated line segments. More...
 
CracksetSeed (Ogre::uint seed)
 Set the seed for "random" number generator. More...
 
CracksetLengthDecision (CRACK_LENGTH_DECISION lengthdecision)
 Set method for calculating the line segments length. More...
 
CracksetQuality (CRACK_QUALITY quality)
 Set method for high quality painting. 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

Create lines that can be randomly cracked or follow a normal map.

Number, length and variation of cracked lines can be set; high quality mode is available.

Normal tracking
Lines are drawn where normals look at sides (r, g channels are set tosomething different than 127), and according the difference between alpha channel and normals elevation. By default, normals are rotated 90 degrees with X axis flipped, so that they "wrap" objects.

Example:

// Image input
Procedural::TextureBuffer bufferGradient(256);
// Image structure
Procedural::TextureBuffer bufferCloud(256);
Procedural::Cloud(&bufferCloud).process();
// Filter
Procedural::Crack(&bufferCloud).setParameterImage(&bufferGradient).process();

dot_texture_10.png

Member Enumeration Documentation

◆ CRACK_LENGTH_DECISION

Methods how to create line length.

Enumerator
LENGTH_DECISION_RANDOM 

Use a random number generator.

LENGTH_DECISION_CONSTANT 

Use a constant value.

LENGTH_DECISION_NORMAL_BASED 

Use a normal map.

◆ CRACK_QUALITY

High quality settings.

Enumerator
QUALITY_HIGH_OFF 

Switch high quality off.

QUALITY_ALPHA 

Use alpha channel.

QUALITY_SUBPIXEL 

Use sub pixel block.

Constructor & Destructor Documentation

◆ Crack()

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

Run image manipulation.

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

Implements Procedural::TextureProcessing.

◆ setColour() [1/2]

Crack& Procedural::Crack::setColour ( Ogre::ColourValue  colour)

Set the colour to draw.

Parameters
colourNew colour for drawing (default Ogre::ColourValue::White)

◆ setColour() [2/2]

Crack& Procedural::Crack::setColour ( Ogre::Real  red,
Ogre::Real  green,
Ogre::Real  blue,
Ogre::Real  alpha = 1.0f 
)

Set the colour to draw.

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

◆ setCount()

Crack& Procedural::Crack::setCount ( Ogre::uint  count)

Set the number of generated lines.

Parameters
countNew number of lines to generate (default 100)

◆ setLength()

Crack& Procedural::Crack::setLength ( Ogre::uchar  length)

Set the minimum length of generated line segments.

Parameters
lengthNew minimal length of the generated line segments (default 255)

◆ setLengthDecision()

Crack& Procedural::Crack::setLengthDecision ( CRACK_LENGTH_DECISION  lengthdecision)

Set method for calculating the line segments length.

Parameters
lengthdecisionNew decision length (default LENGTH_DECISION_RANDOM)

◆ setLog()

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

Enable/Disable logging.

Parameters
enabletrue enables logging of filter actions

◆ setParameterImage()

Crack& Procedural::Crack::setParameterImage ( TextureBufferPtr  image)

Set parameter image for normal mapping.

Parameters
imagePointer to second image (default NULL)
Note
If the parameter image is set to NULL there won't be any compensation.

◆ setQuality()

Crack& Procedural::Crack::setQuality ( CRACK_QUALITY  quality)

Set method for high quality painting.

Parameters
qualityNew high quality setting (default QUALITY_HIGH_OFF)

◆ setSeed()

Crack& Procedural::Crack::setSeed ( Ogre::uint  seed)

Set the seed for "random" number generator.

Parameters
seedSeed value where to set the random number generator (default 5120)

◆ setVariation()

Crack& Procedural::Crack::setVariation ( Ogre::uchar  variation)

Set the smoothness of generated lines.

Parameters
variationNew value for the smoothness of the generated lines (default 64)

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::Crack
Create lines that can be randomly cracked or follow a normal map.
Definition: ProceduralTextureModifiers.h:966
Ogre::ColourValue::Red
static const ColourValue Red
Ogre::ColourValue::Black
static const ColourValue Black
Procedural::Gradient::process
TextureBufferPtr process()
Run image generation.
Procedural::Gradient::setColours
Gradient & setColours(Ogre::ColourValue colourA, Ogre::ColourValue colourB, Ogre::ColourValue colourC, Ogre::ColourValue colourD)
Sets the colours of the image corners.
Procedural::Cloud
Creates a cloud structured image.
Definition: ProceduralTextureGenerator.h:174
Ogre::ColourValue::Blue
static const ColourValue Blue
Procedural::Crack::setParameterImage
Crack & setParameterImage(TextureBufferPtr image)
Set parameter image for normal mapping.
Procedural::Gradient
Fills full image with given colour gradients.
Definition: ProceduralTextureGenerator.h:229
Procedural::Crack::process
TextureBufferPtr process()
Run image manipulation.
Procedural::Cloud::process
TextureBufferPtr process()
Run image generation.
Ogre::ColourValue::Green
static const ColourValue Green
Procedural::TextureBuffer
class to store image data while processing
Definition: ProceduralTextureBuffer.h:50