OGRE  13.2
Object-Oriented Graphics Rendering Engine
Ogre::RTShader::NormalMapLighting Class Reference

Normal Map Lighting extension sub render state implementation. More...

#include <OgreShaderExNormalMapLighting.h>

+ Inheritance diagram for Ogre::RTShader::NormalMapLighting:

Public Types

enum  NormalMapSpace { NMS_OBJECT = 1, NMS_TANGENT = 2, NMS_PARALLAX = 6 }
 Normal map space definition. More...
 

Public Member Functions

 NormalMapLighting ()
 Class default constructor. More...
 
virtual void copyFrom (const SubRenderState &rhs)
 
int getExecutionOrder () const
 Get the execution order of this sub render state. More...
 
const SamplerPtrgetNormalMapSampler () const
 return the normal map sampler More...
 
NormalMapSpace getNormalMapSpace () const
 Return the normal map space. More...
 
const StringgetNormalMapTextureName () const
 Return the normal map texture name. More...
 
unsigned int getTexCoordIndex () const
 Return the index of the input vertex shader texture coordinate set. More...
 
virtual const StringgetType () const
 
virtual bool preAddToRenderState (const RenderState *renderState, Pass *srcPass, Pass *dstPass)
 
void setNormalMapSampler (const SamplerPtr &sampler)
 set the normal map sampler More...
 
void setNormalMapSpace (NormalMapSpace normalMapSpace)
 Set the normal map space. More...
 
void setNormalMapTextureName (const String &textureName)
 Set the normal map texture name. More...
 
bool setParameter (const String &name, const String &value) override
 generic set method for parameters that connot be derived in preAddToRenderState More...
 
void setTexCoordIndex (unsigned int index)
 Set the index of the input vertex shader texture coordinate set. More...
 
- Public Member Functions inherited from Ogre::RTShader::SubRenderState
 SubRenderState ()
 Class default constructor. More...
 
virtual ~SubRenderState ()
 Class destructor. More...
 
SubRenderStateAccessorPtr getAccessor ()
 Return the accessor object to this sub render state. More...
 
SubRenderStateAccessorPtr getAccessor () const
 Return the accessor object to this sub render state. More...
 
SubRenderStateoperator= (const SubRenderState &rhs)
 Operator = declaration. More...
 
virtual void updateGpuProgramsParams (Renderable *rend, const Pass *pass, const AutoParamDataSource *source, const LightList *pLightList)
 Update GPU programs parameters before a rendering operation occurs. More...
 

Static Public Attributes

static String Type
 

Detailed Description

Normal Map Lighting extension sub render state implementation.

Derives from SubRenderState class.

Member Enumeration Documentation

◆ NormalMapSpace

Normal map space definition.

Enumerator
NMS_OBJECT 

Normal map contains normal data in object local space.

This normal mapping technique has the advantages of better visualization results, lack of artifacts that comes from texture mirroring usage, it doesn't requires tangent and it also saves some instruction in the vertex shader stage. The main drawback of using this kind of normal map is that the target object must be static in terms of local space rotations and translations.

NMS_TANGENT 

Normal map contains normal data in tangent space.

This is the default normal mapping behavior and it requires that the target mesh will have valid tangents within its vertex data.

NMS_PARALLAX 

Normal map contains normal data in parallax corrected tangent space The restrictions of NMS_TANGENT apply.

Additionally the alpha channel of the normal texture is expected to contain height displacement data. This is used for parallax corrected rendering.

Constructor & Destructor Documentation

◆ NormalMapLighting()

Ogre::RTShader::NormalMapLighting::NormalMapLighting ( )

Class default constructor.

Member Function Documentation

◆ getType()

virtual const String& Ogre::RTShader::NormalMapLighting::getType ( ) const
virtual

◆ getExecutionOrder()

int Ogre::RTShader::NormalMapLighting::getExecutionOrder ( ) const
inlinevirtual

Get the execution order of this sub render state.

Remarks
The return value should be synchronized with the predefined values of the FFPShaderStage enum.

Implements Ogre::RTShader::SubRenderState.

References Ogre::RTShader::FFP_LIGHTING.

◆ copyFrom()

virtual void Ogre::RTShader::NormalMapLighting::copyFrom ( const SubRenderState rhs)
virtual

◆ preAddToRenderState()

virtual bool Ogre::RTShader::NormalMapLighting::preAddToRenderState ( const RenderState renderState,
Pass srcPass,
Pass dstPass 
)
virtual

◆ setTexCoordIndex()

void Ogre::RTShader::NormalMapLighting::setTexCoordIndex ( unsigned int  index)
inline

Set the index of the input vertex shader texture coordinate set.

◆ getTexCoordIndex()

unsigned int Ogre::RTShader::NormalMapLighting::getTexCoordIndex ( ) const
inline

Return the index of the input vertex shader texture coordinate set.

◆ setNormalMapSpace()

void Ogre::RTShader::NormalMapLighting::setNormalMapSpace ( NormalMapSpace  normalMapSpace)
inline

Set the normal map space.

Parameters
normalMapSpaceThe normal map space.

◆ getNormalMapSpace()

NormalMapSpace Ogre::RTShader::NormalMapLighting::getNormalMapSpace ( ) const
inline

Return the normal map space.

◆ setNormalMapTextureName()

void Ogre::RTShader::NormalMapLighting::setNormalMapTextureName ( const String textureName)
inline

Set the normal map texture name.

◆ getNormalMapTextureName()

const String& Ogre::RTShader::NormalMapLighting::getNormalMapTextureName ( ) const
inline

Return the normal map texture name.

◆ getNormalMapSampler()

const SamplerPtr& Ogre::RTShader::NormalMapLighting::getNormalMapSampler ( ) const
inline

return the normal map sampler

◆ setNormalMapSampler()

void Ogre::RTShader::NormalMapLighting::setNormalMapSampler ( const SamplerPtr sampler)
inline

set the normal map sampler

◆ setParameter()

bool Ogre::RTShader::NormalMapLighting::setParameter ( const String name,
const String value 
)
overridevirtual

generic set method for parameters that connot be derived in preAddToRenderState

Reimplemented from Ogre::RTShader::SubRenderState.

Member Data Documentation

◆ Type

String Ogre::RTShader::NormalMapLighting::Type
static

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