Skip to content

Commit dd89a2f

Browse files
committed
bugfix(scene): Fix translucent objects drawn without translucency when no occluders are in the scene
1 parent cb57c1b commit dd89a2f

File tree

1 file changed

+8
-1
lines changed
  • GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient

1 file changed

+8
-1
lines changed

GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScene.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1410,6 +1410,7 @@ void RTS3DScene::flushOccludedObjectsIntoStencil(RenderInfoClass & rinfo)
14101410
DrawableInfo *drawInfo=((DrawableInfo *)(*renderList)->Get_User_Data());
14111411
if (drawInfo->m_flags & DrawableInfo::ERF_IS_TRANSLUCENT)
14121412
{
1413+
// TheSuperHackers @info This only draws the occlusion of translucent objects.
14131414
TheDX8MeshRenderer.Flush(); //render all the submitted meshes using current stencil function
14141415
SHD_FLUSH;
14151416
//Disable writing to color buffer since translucent objects are rendered at end of frame.
@@ -1496,7 +1497,13 @@ void RTS3DScene::flushOccludedObjectsIntoStencil(RenderInfoClass & rinfo)
14961497
Int k=0;
14971498
for (; k<m_numPotentialOccludees; k++)
14981499
{
1499-
renderOneObject(rinfo, (*occludeeList), localPlayerIndex);
1500+
// TheSuperHackers @bugfix xezon 18/10/2025 No longer draws translucent objects
1501+
// as non-translucent ones here. They are drawn in another pass.
1502+
DrawableInfo *drawInfo = static_cast<DrawableInfo *>((*occludeeList)->Get_User_Data());
1503+
if ((drawInfo->m_flags & DrawableInfo::ERF_IS_TRANSLUCENT) == 0)
1504+
{
1505+
renderOneObject(rinfo, (*occludeeList), localPlayerIndex);
1506+
}
15001507
occludeeList++; //advance to next one
15011508
}
15021509

0 commit comments

Comments
 (0)