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

Method shouldRender

Engine/source/lighting/common/projectedShadow.cpp:126–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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