Skip to content

Commit 68efcde

Browse files
committed
bugfix(scene): Fix translucent objects drawn without translucency when no occluders are in the scene (#1710)
1 parent d83c8c9 commit 68efcde

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
@@ -1411,6 +1411,7 @@ void RTS3DScene::flushOccludedObjectsIntoStencil(RenderInfoClass & rinfo)
14111411
DrawableInfo *drawInfo=((DrawableInfo *)(*renderList)->Get_User_Data());
14121412
if (drawInfo->m_flags & DrawableInfo::ERF_IS_TRANSLUCENT)
14131413
{
1414+
// TheSuperHackers @info This only draws the occlusion of translucent objects.
14141415
TheDX8MeshRenderer.Flush(); //render all the submitted meshes using current stencil function
14151416
SHD_FLUSH;
14161417
//Disable writing to color buffer since translucent objects are rendered at end of frame.
@@ -1497,7 +1498,13 @@ void RTS3DScene::flushOccludedObjectsIntoStencil(RenderInfoClass & rinfo)
14971498
Int k=0;
14981499
for (; k<m_numPotentialOccludees; k++)
14991500
{
1500-
renderOneObject(rinfo, (*occludeeList), localPlayerIndex);
1501+
// TheSuperHackers @bugfix xezon 18/10/2025 No longer draws translucent objects
1502+
// as non-translucent ones here. They are drawn in another pass.
1503+
DrawableInfo *drawInfo = static_cast<DrawableInfo *>((*occludeeList)->Get_User_Data());
1504+
if ((drawInfo->m_flags & DrawableInfo::ERF_IS_TRANSLUCENT) == 0)
1505+
{
1506+
renderOneObject(rinfo, (*occludeeList), localPlayerIndex);
1507+
}
15011508
occludeeList++; //advance to next one
15021509
}
15031510

0 commit comments

Comments
 (0)