TSRenderState
Engine/source/ts/tsRenderState.h
A simple class for passing render state through the pre-render pipeline.
Get/Set methods.
setSceneState(const SceneRenderState * state)
setCubemap(GFXCubemap * cubemap)
setFadeOverride(F32 fade)
bool
setNoRenderTranslucent(bool noRenderTrans)
bool
setNoRenderNonTranslucent(bool noRenderNonTrans)
void *
setMaterialHint(void * materialHint)
setOriginSort(bool enable)
bool
setLightQuery(LightQuery * query)
setAccuTex(GFXTextureObject * query)
setNodeTransforms(MatrixF * list, U32 count)
@ see mNodeTransforms, mNodeTransformCount
getNodeTransforms(MatrixF ** list, U32 * count)
Protected Attributes
Used to override the normal fade value of an object.
The lighting query object used if any materials are forward lit and need lights.
void *
A generic hint value passed from the game code down to the material for use by shader features.
Count of matrices in the mNodeTransforms list.
MatrixF *
List of matrices to use for hardware skinning.
bool
These are used in some places TSShapeInstance::render, however, it appears they are never set to anything other than false.
bool
Use the origin point of the mesh for distance sorting for transparency instead of the nearest bounding box point.
Public Functions
TSRenderState(const TSRenderState & state)
Detailed Description
A simple class for passing render state through the pre-render pipeline.
Introduction
TSRenderState holds on to certain pieces of data that may be set at the preparation stage of rendering (prepRengerImage etc.) which are needed further along in the process of submitting a render instance for later rendering by the RenderManager.
It was created to clean up and refactor the DTS rendering from having a large number of static data that would be used in varying places. These statics were confusing and would often cause problems when not properly cleaned up by various objects after submitting their RenderInstances.
What Does TSRenderState Do?
TSRenderState is a simple class that performs the function of passing along (from the prep function(s) to the actual submission) the data needed for the desired state of rendering.
Usage Example
TSRenderState is very easy to use. Merely create a TSRenderState object (in prepRenderImage usually) and set any of the desired data members (SceneRenderState, camera transform etc.), and pass the address of your TSRenderState to your render function.
Get/Set methods.
getSceneState()
setSceneState(const SceneRenderState * state)
getCubemap()
setCubemap(GFXCubemap * cubemap)
getFadeOverride()
setFadeOverride(F32 fade)
isNoRenderTranslucent()
setNoRenderTranslucent(bool noRenderTrans)
isNoRenderNonTranslucent()
setNoRenderNonTranslucent(bool noRenderNonTrans)
getMaterialHint()
setMaterialHint(void * materialHint)
getCuller()
setCuller(const Frustum * culler)
setOriginSort(bool enable)
useOriginSort()
setLightQuery(LightQuery * query)
getLightQuery()
setAccuTex(GFXTextureObject * query)
getAccuTex()
addCustomShaderBinding(CustomShaderBindingData data)
getCustomShaderBinding()
setNodeTransforms(MatrixF * list, U32 count)
@ see mNodeTransforms, mNodeTransformCount
getNodeTransforms(MatrixF ** list, U32 * count)
Protected Attributes
GFXTextureObject * mAccuTex
GFXCubemap * mCubemap
const Frustum * mCuller
An optional object space frustum used to cull subobjects within the shape.
Vector< CustomShaderBindingData > mCustomShaderData
F32 mFadeOverride
Used to override the normal fade value of an object.
This is multiplied by the current fade value of the instance to gain the resulting visibility fade (see TSMesh::render()).
LightQuery * mLightQuery
The lighting query object used if any materials are forward lit and need lights.
void * mMaterialHint
A generic hint value passed from the game code down to the material for use by shader features.
U32 mNodeTransformCount
Count of matrices in the mNodeTransforms list.
MatrixF * mNodeTransforms
List of matrices to use for hardware skinning.
bool mNoRenderNonTranslucent
bool mNoRenderTranslucent
These are used in some places TSShapeInstance::render, however, it appears they are never set to anything other than false.
We provide methods for setting them regardless.
const SceneRenderState * mState
bool mUseOriginSort
Use the origin point of the mesh for distance sorting for transparency instead of the nearest bounding box point.