OSG
3.4.0
|
#include <TangentSpaceGenerator.h>
Protected Member Functions | |
virtual | ~TangentSpaceGenerator () |
TangentSpaceGenerator & | operator= (const TangentSpaceGenerator &) |
void | compute (osg::PrimitiveSet *pset, const osg::Array *vx, const osg::Array *nx, const osg::Array *tx, int iA, int iB, int iC) |
![]() | |
virtual | ~Referenced () |
void | signalObserversAndDelete (bool signalDelete, bool doDelete) const |
void | deleteUsingDeleteHandler () const |
Protected Attributes | |
osg::ref_ptr< osg::Vec4Array > | T_ |
osg::ref_ptr< osg::Vec4Array > | B_ |
osg::ref_ptr< osg::Vec4Array > | N_ |
osg::ref_ptr< osg::UIntArray > | indices_ |
![]() | |
OpenThreads::AtomicPtr | _observerSet |
OpenThreads::Atomic | _refCount |
Additional Inherited Members | |
![]() | |
static OpenThreads::Mutex * | getGlobalReferencedMutex () |
static void | setThreadSafeReferenceCounting (bool enableThreadSafeReferenceCounting) |
static bool | getThreadSafeReferenceCounting () |
static void | setDeleteHandler (DeleteHandler *handler) |
static DeleteHandler * | getDeleteHandler () |
The TangentSpaceGenerator class generates three arrays containing tangent-space basis vectors. It takes a texture-mapped Geometry object as input, traverses its primitive sets and computes Tangent, Normal and Binormal vectors for each vertex, storing them into arrays. The resulting arrays can be used as vertex program varying (per-vertex) parameters, enabling advanced effects like bump-mapping. To use this class, simply call the generate() method specifying the Geometry object you want to process and the texture unit that contains UV mapping for the normal map; then you can retrieve the TBN arrays by calling getTangentArray(), getNormalArray() and getBinormalArray() methods.
Definition at line 38 of file TangentSpaceGenerator.h.
osgUtil::TangentSpaceGenerator::TangentSpaceGenerator | ( | ) |
osgUtil::TangentSpaceGenerator::TangentSpaceGenerator | ( | const TangentSpaceGenerator & | copy, |
const osg::CopyOp & | copyop = osg::CopyOp::SHALLOW_COPY |
||
) |
|
inlineprotectedvirtual |
Definition at line 61 of file TangentSpaceGenerator.h.
|
protected |
void osgUtil::TangentSpaceGenerator::generate | ( | osg::Geometry * | geo, |
int | normal_map_tex_unit = 0 |
||
) |
|
inline |
Definition at line 53 of file TangentSpaceGenerator.h.
|
inline |
Definition at line 54 of file TangentSpaceGenerator.h.
|
inline |
Definition at line 57 of file TangentSpaceGenerator.h.
|
inline |
Definition at line 49 of file TangentSpaceGenerator.h.
|
inline |
Definition at line 50 of file TangentSpaceGenerator.h.
|
inline |
Definition at line 45 of file TangentSpaceGenerator.h.
|
inline |
Definition at line 46 of file TangentSpaceGenerator.h.
|
inlineprotected |
Definition at line 62 of file TangentSpaceGenerator.h.
|
inline |
Definition at line 55 of file TangentSpaceGenerator.h.
|
inline |
Definition at line 51 of file TangentSpaceGenerator.h.
|
inline |
Definition at line 47 of file TangentSpaceGenerator.h.
|
protected |
Definition at line 71 of file TangentSpaceGenerator.h.
|
protected |
Definition at line 73 of file TangentSpaceGenerator.h.
|
protected |
Definition at line 72 of file TangentSpaceGenerator.h.
|
protected |
Definition at line 70 of file TangentSpaceGenerator.h.