void d3d_ProcessSprite(LTObject *pObject) { if (!g_CV_DrawSprites) return; VisibleSet *pVisibleSet = d3d_GetVisibleSet(); BaseObjectSet *pSet = (pObject->m_Flags & FLAG_SPRITE_NOZ) ? &pVisibleSet->m_NoZSprites : &pVisibleSet->m_TranslucentSprites; pSet->Add(pObject); }
// ---------------------------------------------------------------- // // External functions. // ---------------------------------------------------------------- // void d3d_ProcessPolyGrid(LTObject *pObject) { if(!g_CV_DrawPolyGrids) return; if (pObject->IsTranslucent()) { //see if it needs to be rendered before other translucent objects though if(pObject->ToPolyGrid()->m_nPGFlags & PG_RENDERBEFORETRANSLUCENTS) { d3d_GetVisibleSet()->m_EarlyTranslucentPolyGrids.Add(pObject); } else { d3d_GetVisibleSet()->m_TranslucentPolyGrids.Add(pObject); } } else { d3d_GetVisibleSet()->m_SolidPolyGrids.Add(pObject); } }
void d3d_DrawNoZSprites(const ViewParams& Params) { CountAdder cTicks_Sprite(g_pSceneDesc->m_pTicks_Render_Sprites); VisibleSet *pVisibleSet; BaseObjectSet *pSet; pVisibleSet = d3d_GetVisibleSet(); VERIFY_TRANSLUCENTOBJECTSTATES(); // Draw the NoZ sprites. pSet = &pVisibleSet->m_NoZSprites; if (pSet->m_nObjects > 0) { StateSet ssZEnable(D3DRS_ZENABLE, FALSE); pSet->Draw(Params, d3d_DrawSprite); } }
// Translucent sprite queueing hook function for sorting void d3d_QueueTranslucentSprites(const ViewParams& Params, ObjectDrawList& DrawList) { d3d_GetVisibleSet()->m_TranslucentSprites.Queue(DrawList, Params, d3d_DrawSprite); }
// Translucent polygrid queueing hook function for sorting void d3d_QueueTranslucentPolyGrids(const ViewParams& Params, ObjectDrawList& DrawList) { d3d_GetVisibleSet()->m_TranslucentPolyGrids.Queue(DrawList, Params, d3d_DrawPolyGrid); }
void d3d_DrawEarlyTranslucentPolyGrids(const ViewParams& Params) { d3d_GetVisibleSet()->m_EarlyTranslucentPolyGrids.Draw(Params, d3d_DrawPolyGrid); }
void d3d_DrawSolidPolyGrids(const ViewParams& Params) { d3d_GetVisibleSet()->m_SolidPolyGrids.Draw(Params, d3d_DrawPolyGrid); }
void d3d_FlushObjectQueues(const ViewParams& Params) { //this is static to prevent having to do allocations per frame static ObjectDrawList s_TransObjList; //make sure that the models are all setup g_ModelDraw.QueueAllModelInfo(); // Draw all the solid things. d3d_DrawSolidWorldModels(Params); d3d_DrawSolidPolyGrids(Params); d3d_DrawSolidVolumeEffects(Params); d3d_DrawSolidCanvases(Params); //before we draw all the translucent objects, we should draw the shadows //that we have queued up CRenderShadowList::GetSingleton().RenderQueuedShadows(Params); //we should draw the models last. They may be tagged as solid but some render styles //may still be using transparency so this is safest if done last d3d_DrawSolidModels(Params); // Last, draw all the translucent things. d3d_SetTranslucentObjectStates(); // Draw polygrids that have been tagged to render before other translucent objects // to prevent sorting issues d3d_DrawEarlyTranslucentPolyGrids(Params); // These next 7 object types will be sorted into the object list d3d_QueueTranslucentParticles(Params, s_TransObjList); d3d_QueueTranslucentPolyGrids(Params, s_TransObjList); d3d_QueueLineSystems(Params, s_TransObjList); d3d_QueueTranslucentWorldModels(Params, s_TransObjList); d3d_QueueTranslucentModels(Params, s_TransObjList); d3d_QueueTranslucentCanvases(Params, s_TransObjList); d3d_QueueTranslucentSprites(Params, s_TransObjList); d3d_QueueTranslucentVolumeEffects(Params, s_TransObjList); s_TransObjList.Draw(Params); // This must come last because of the Z-Buffer disable. d3d_DrawNoZSprites(Params); d3d_UnsetTranslucentObjectStates(true); if(g_CV_ShowRenderedObjectCounts.m_Val) { VisibleSet *pVisibleSet; pVisibleSet = d3d_GetVisibleSet(); if (g_CV_ShowRenderedObjectCounts.m_Val == 2) { d3d_CheckForDuplicateObjects(pVisibleSet); } dsi_ConsolePrint("Line Systems: %d", pVisibleSet->m_LineSystems.m_nObjects); dsi_ConsolePrint("No Z Sprites: %d", pVisibleSet->m_NoZSprites.m_nObjects); dsi_ConsolePrint("Lights: %d", pVisibleSet->m_Lights.m_nObjects); dsi_ConsolePrint("Particle Systems: %d", pVisibleSet->m_ParticleSystems.m_nObjects); dsi_ConsolePrint("Solid Canvases: %d", pVisibleSet->m_SolidCanvases.m_nObjects); dsi_ConsolePrint("Solid Models: %d", pVisibleSet->m_SolidModels.m_nObjects); dsi_ConsolePrint("Solid Poly Grids: %d", pVisibleSet->m_SolidPolyGrids.m_nObjects); dsi_ConsolePrint("Solid Volume Effects: %d", pVisibleSet->m_SolidVolumeEffects.m_nObjects); dsi_ConsolePrint("Solid World Models: %d", pVisibleSet->m_SolidWorldModels.m_nObjects); dsi_ConsolePrint("Translucent Canvases: %d", pVisibleSet->m_TranslucentCanvases.m_nObjects); dsi_ConsolePrint("Translucent Models: %d", pVisibleSet->m_TranslucentModels.m_nObjects); dsi_ConsolePrint("Translucent Poly Grids: %d", pVisibleSet->m_TranslucentPolyGrids.m_nObjects + pVisibleSet->m_EarlyTranslucentPolyGrids.m_nObjects); dsi_ConsolePrint("Translucent Sprites: %d", pVisibleSet->m_TranslucentSprites.m_nObjects); dsi_ConsolePrint("Translucent Volume Effects: %d", pVisibleSet->m_TranslucentVolumeEffects.m_nObjects); dsi_ConsolePrint("Translucent World Models: %d", pVisibleSet->m_TranslucentWorldModels.m_nObjects); } }