OGRE
1.10.12
Object-Oriented Graphics Rendering Engine
|
Class for calculating a tangent space basis. More...
#include <OgreTangentSpaceCalc.h>
Classes | |
struct | IndexRemap |
Information about a remapped index. More... | |
struct | Result |
The result of having built a tangent space basis. More... | |
Public Types | |
typedef list< IndexRemap >::type | IndexRemapList |
List of indexes that were remapped (split vertices). More... | |
typedef std::pair< size_t, size_t > | VertexSplit |
typedef list< VertexSplit >::type | VertexSplits |
Public Member Functions | |
TangentSpaceCalc () | |
void | addIndexData (IndexData *i_in, RenderOperation::OperationType opType=RenderOperation::OT_TRIANGLE_LIST) |
Add a set of index data that references the vertex data. More... | |
Result | build (VertexElementSemantic targetSemantic=VES_TANGENT, unsigned short sourceTexCoordSet=0, unsigned short index=1) |
Build a tangent space basis from the provided data. More... | |
void | clear () |
Reset the calculation object. More... | |
bool | getSplitMirrored () const |
Gets whether or not to split vertices when a mirrored tangent space transition is detected. More... | |
bool | getSplitRotated () const |
Sets whether or not to split vertices when tangent space rotates more than 90 degrees around a vertex. More... | |
bool | getStoreParityInW () const |
Gets whether to store tangent space parity in the W of a 4-component tangent or not. More... | |
void | setSplitMirrored (bool split) |
Sets whether or not to split vertices when a mirrored tangent space transition is detected (matrix parity differs). More... | |
void | setSplitRotated (bool split) |
Sets whether or not to split vertices when tangent space rotates more than 90 degrees around a vertex. More... | |
void | setStoreParityInW (bool enabled) |
Sets whether to store tangent space parity in the W of a 4-component tangent or not. More... | |
void | setVertexData (VertexData *v_in) |
Set the incoming vertex data (which will be modified) More... | |
Class for calculating a tangent space basis.
typedef std::pair<size_t, size_t> Ogre::TangentSpaceCalc::VertexSplit |
typedef list<IndexRemap>::type Ogre::TangentSpaceCalc::IndexRemapList |
List of indexes that were remapped (split vertices).
typedef list<VertexSplit>::type Ogre::TangentSpaceCalc::VertexSplits |
Ogre::TangentSpaceCalc::TangentSpaceCalc | ( | ) |
void Ogre::TangentSpaceCalc::clear | ( | ) |
Reset the calculation object.
void Ogre::TangentSpaceCalc::setVertexData | ( | VertexData * | v_in | ) |
Set the incoming vertex data (which will be modified)
void Ogre::TangentSpaceCalc::addIndexData | ( | IndexData * | i_in, |
RenderOperation::OperationType | opType = RenderOperation::OT_TRIANGLE_LIST |
||
) |
Add a set of index data that references the vertex data.
This might be modified if there are vertex splits.
|
inline |
Sets whether to store tangent space parity in the W of a 4-component tangent or not.
enabled | true to enable 4-component tangents (default false). If you enable this, you will probably also want to enable mirror splitting (see setSplitMirrored), and your shader must understand how to deal with the parity. |
|
inline |
Gets whether to store tangent space parity in the W of a 4-component tangent or not.
|
inline |
Sets whether or not to split vertices when a mirrored tangent space transition is detected (matrix parity differs).
|
inline |
Gets whether or not to split vertices when a mirrored tangent space transition is detected.
|
inline |
Sets whether or not to split vertices when tangent space rotates more than 90 degrees around a vertex.
|
inline |
Sets whether or not to split vertices when tangent space rotates more than 90 degrees around a vertex.
References Ogre::TangentSpaceCalc::IndexRemap::faceIndex, Ogre::TangentSpaceCalc::Result::indexesRemapped, Ogre::TangentSpaceCalc::IndexRemap::indexSet, Ogre::TangentSpaceCalc::IndexRemap::splitVertex, Ogre::VES_TANGENT, and Ogre::Vector3::ZERO.
Result Ogre::TangentSpaceCalc::build | ( | VertexElementSemantic | targetSemantic = VES_TANGENT , |
unsigned short | sourceTexCoordSet = 0 , |
||
unsigned short | index = 1 |
||
) |
Build a tangent space basis from the provided data.
targetSemantic | The semantic to store the tangents in. Defaults to the explicit tangent binding, but note that this is only usable on more modern hardware (Shader Model 2), so if you need portability with older cards you should change this to a texture coordinate binding instead. |
sourceTexCoordSet | The texture coordinate index which should be used as the source of 2D texture coordinates, with which to calculate the tangents. |
index | The element index, ie the texture coordinate set which should be used to store the 3D coordinates representing a tangent vector per vertex, if targetSemantic is VES_TEXTURE_COORDINATES. If this already exists, it will be overwritten. |