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

Method _innerRender

Engine/source/renderInstance/renderImposterMgr.cpp:135–361  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133}
134
135void RenderImposterMgr::_innerRender( const SceneRenderState *state, RenderDeferredMgr *deferredBin )
136{
137 if (deferredBin == NULL) return;
138 PROFILE_SCOPE( RenderImposterMgr_InnerRender );
139
140 // Capture the GFX stats for this render.
141 GFXDeviceStatistics stats;
142 stats.start( GFX->getDeviceStatistics() );
143
144 GFXTransformSaver saver;
145
146 // Restore transforms
147 MatrixSet &matrixSet = getRenderPass()->getMatrixSet();
148 matrixSet.restoreSceneViewProjection();
149 matrixSet.setWorld( MatrixF::Identity );
150
151 // Setup the large static index buffer for rendering the imposters.
152 if ( !mIB.isValid() )
153 {
154 // Setup a static index buffer for rendering.
155 mIB.set( GFX, smImposterBatchSize * 6, 0, GFXBufferTypeStatic );
156 U16 *idxBuff;
157 mIB.lock(&idxBuff, NULL, 0, 0);
158 for ( U32 i=0; i < smImposterBatchSize; i++ )
159 {
160 //
161 // The vertex pattern in the VB for each
162 // imposter is as follows...
163 //
164 // 0----1
165 // |\ |
166 // | \ |
167 // | \ |
168 // | \|
169 // 3----2
170 //
171 // We setup the index order below to ensure
172 // sequental, cache friendly, access.
173 //
174 U32 offset = i * 4;
175 idxBuff[i*6+0] = 0 + offset;
176 idxBuff[i*6+1] = 1 + offset;
177 idxBuff[i*6+2] = 2 + offset;
178 idxBuff[i*6+3] = 2 + offset;
179 idxBuff[i*6+4] = 3 + offset;
180 idxBuff[i*6+5] = 0 + offset;
181 }
182 mIB.unlock();
183 }
184
185 /*
186 if ( !mCornerVB.isValid() )
187 {
188 // Setup a static vertex buffer for the corner index for each imposter state.
189 mCornerVB.set( GFX, smImposterBatchSize * 4, GFXBufferTypeStatic );
190 ImposterCorner *corner = mCornerVB.lock( 0 );
191 for ( U32 i=0; i < smImposterBatchSize; i++ )
192 {

Callers

nothing calls this directly

Calls 15

getDeviceStatisticsMethod · 0.80
setPrimitiveBufferMethod · 0.80
getDefaultLightMethod · 0.80
getDeferredMaterialMethod · 0.80
setVertexBufferMethod · 0.80
dMemcpyFunction · 0.50
startMethod · 0.45
isValidMethod · 0.45
setMethod · 0.45
lockMethod · 0.45
unlockMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected