MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / shouldRender

Method shouldRender

Engine/source/lighting/common/projectedShadow.cpp:122–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120}
121
122bool ProjectedShadow::shouldRender( const SceneRenderState *state )
123{
124 // Don't render if our object has been removed from the
125 // scene graph.
126
127 if( !mParentObject->getSceneManager() )
128 return false;
129
130 // Don't render if the ShapeBase
131 // object's fade value is greater
132 // than the visibility epsilon.
133 bool shapeFade = mShapeBase && mShapeBase->getFadeVal() < TSMesh::VISIBILITY_EPSILON;
134
135 // Get the shapebase datablock if we have one.
136 ShapeBaseData *data = NULL;
137 if ( mShapeBase )
138 data = static_cast<ShapeBaseData*>( mShapeBase->getDataBlock() );
139
140 // Also don't render if
141 // the camera distance is greater
142 // than the shadow length.
143 if ( shapeFade || !mDecalData ||
144 ( mDecalInstance &&
145 mDecalInstance->calcPixelSize( state->getViewport().extent.y, state->getCameraPosition(), state->getWorldToScreenScale().y ) < mDecalInstance->mDataBlock->fadeEndPixelSize ) )
146 {
147 // Release our shadow texture
148 // so that others can grab it out
149 // of the pool.
150 mShadowTexture = NULL;
151
152 return false;
153 }
154
155 return true;
156}
157
158bool ProjectedShadow::_updateDecal( const SceneRenderState *state )
159{

Callers

nothing calls this directly

Calls 5

getFadeValMethod · 0.80
calcPixelSizeMethod · 0.80
getWorldToScreenScaleMethod · 0.80
getSceneManagerMethod · 0.45
getDataBlockMethod · 0.45

Tested by

no test coverage detected