MCPcopy Create free account
hub / github.com/carbonengine/trinity / PrepareTransparentBatch

Method PrepareTransparentBatch

trinity/Eve/EveSpaceScene.cpp:835–849  ·  view source on GitHub ↗

-------------------------------------------------------------------------------------- Description: Sorts and gathers transparent batches Arguments: objectsWithTransparencies - a list of renderables with transparencies batches - the batch map to be used --------------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

833// batches - the batch map to be used
834// --------------------------------------------------------------------------------------
835void EveSpaceScene::PrepareTransparentBatch( Tr2RenderableSortList& objectsWithTransparencies, BatchMap& batches, Tr2RenderReason reason )
836{
837 CCP_STATS_ZONE( __FUNCTION__ );
838
839 // Sort objects front to back
840 std::stable_sort( objectsWithTransparencies.begin(), objectsWithTransparencies.end() );
841
842 // Add the objects, back to front
843 for( Tr2RenderableSortList::const_reverse_iterator it = objectsWithTransparencies.rbegin(); it != objectsWithTransparencies.rend(); ++it )
844 {
845 ITr2Renderable* r = it->m_object;
846 Tr2PerObjectData* objectData = r->GetPerObjectData( batches[TRIBATCHTYPE_TRANSPARENT] );
847 r->GetBatches( batches[TRIBATCHTYPE_TRANSPARENT], TRIBATCHTYPE_TRANSPARENT, objectData, reason );
848 }
849}
850
851void GetBatchesFromRenderables( ITr2Renderable** const objectRenderables, const unsigned renderableCount, Tr2RenderableSortList* const objectsWithTransparencies, EveSpaceScene::BatchMap& batches, const TriBatchType* batchTypes, const unsigned batchTypeCount, Tr2RenderReason reason )
852{

Callers

nothing calls this directly

Calls 4

beginMethod · 0.45
endMethod · 0.45
GetPerObjectDataMethod · 0.45
GetBatchesMethod · 0.45

Tested by

no test coverage detected