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

Method _innerRender

Engine/source/renderInstance/renderImposterMgr.cpp:134–359  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 15

getDeviceStatisticsMethod · 0.80
setPrimitiveBufferMethod · 0.80
getDefaultLightMethod · 0.80
getPrePassMaterialMethod · 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