OGRE-Next  2.3
Object-Oriented Graphics Rendering Engine
Ogre::VertexShadowMapHelper Class Reference

#include <OgreVertexShadowMapHelper.h>

Static Public Member Functions

static bool findFirstAppearance (const VertexArrayObjectArray &vao, const VertexBufferPacked *vertexBuffer, size_t &outVaoIdx, size_t &outVertexBufferIdx)
 Finds the first occurence of 'vertexBuffer' pointer in vao, and returns its indexes so that vao[outVaoIdx].getVertexBuffers()[outVertexBufferIdx] is the found first occurrence. More...
 
static void optimizeForShadowMapping (VaoManager *vaoManager, const VertexArrayObjectArray &inVao, VertexArrayObjectArray &outVao)
 Reads all the vertex & index buffer from all the LOD levels in inVao, optimizes the buffers for shadow mapping, and stores them as new Vaos in outVao. More...
 
static uint32 shrinkVertexBuffer (uint8 *dstData, const VertexElement2 *vertexElements[3], FastArray< uint32 > &vertexConversionLut, bool hasIndexBuffer, const uint8 *srcData[3], const size_t srcOffset[3], const size_t srcBytesPerVertex[3], uint32 numVertices)
 Copies the contents from srcData into dstData, but shrinking it by removing duplicated vertices. More...
 
static void useSameVaos (VaoManager *vaoManager, const VertexArrayObjectArray &inVao, VertexArrayObjectArray &outVao)
 Copies all the pointers in inVao to outVao so they are identical without cloning any memory. More...
 

Member Function Documentation

◆ findFirstAppearance()

static bool Ogre::VertexShadowMapHelper::findFirstAppearance ( const VertexArrayObjectArray vao,
const VertexBufferPacked vertexBuffer,
size_t &  outVaoIdx,
size_t &  outVertexBufferIdx 
)
static

Finds the first occurence of 'vertexBuffer' pointer in vao, and returns its indexes so that vao[outVaoIdx].getVertexBuffers()[outVertexBufferIdx] is the found first occurrence.

Parameters
vaoVao to look inside.
vertexBufferVertex Buffer to look for.
outVaoIdxThe index to vao[outVaoIdx]. Value is not set if not found.
outVertexBufferIdxThe index to vao[outVaoIdx].getVertexBuffers[outVertexBufferIdx]. Value is not set if not found.
Returns
True if found, false if not found.

◆ optimizeForShadowMapping()

static void Ogre::VertexShadowMapHelper::optimizeForShadowMapping ( VaoManager vaoManager,
const VertexArrayObjectArray inVao,
VertexArrayObjectArray outVao 
)
static

Reads all the vertex & index buffer from all the LOD levels in inVao, optimizes the buffers for shadow mapping, and stores them as new Vaos in outVao.

Remarks
If the buffers can't be optimized (i.e. it is invalid because an LOD level doesn't contain the VES_POSITION semantic), useSameVaos is used; which does not clone the Vaos.
Parameters
vaoManagerVaoManager. Required for buffer management.
inVaoInput Vao to clone and optimize.
outVaoOutput vao to store the cloned, optimized version.

◆ shrinkVertexBuffer()

static uint32 Ogre::VertexShadowMapHelper::shrinkVertexBuffer ( uint8 dstData,
const VertexElement2 vertexElements[3],
FastArray< uint32 > &  vertexConversionLut,
bool  hasIndexBuffer,
const uint8 srcData[3],
const size_t  srcOffset[3],
const size_t  srcBytesPerVertex[3],
uint32  numVertices 
)
static

Copies the contents from srcData into dstData, but shrinking it by removing duplicated vertices.

Duplicated vertices are not removed if there is not index buffer.

Parameters
dstData[inout] Pointer to copy to. Must be numVertices * sum(vertexElements[i]) in size, although amount of written bytes may be lower if there were duplicate vertices.
vertexElements[in] An array with the vertex elements that needs to be copied (i.e. VES_POSITION, VES_BLEND_INDICES & VES_BLEND_WEIGHTS)
vertexConversionLut[out] Table that maps the old vertices to their new location (only useful when the vertex data was actually shrunk)
srcData[in] Pointers where to source the data from.
srcOffset[in] Location in srcData to get each vertex element.
srcBytesPerVertex[in] The vertex size per vertex buffer.
numVertices[in] The total amount of vertices.
Returns
The new vertex count. Will be <= numVertices

◆ useSameVaos()

static void Ogre::VertexShadowMapHelper::useSameVaos ( VaoManager vaoManager,
const VertexArrayObjectArray inVao,
VertexArrayObjectArray outVao 
)
static

Copies all the pointers in inVao to outVao so they are identical without cloning any memory.


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