Skip to content

Conversation

@xezon
Copy link

@xezon xezon commented Sep 17, 2025

This change fixes the missing tree shadow decals while no object shadow decals exist.

The issue happens because the decal draw bounds are only updated when there are object decal shadows (for example under infantry units).

Original

Map: North America

shot_20250917_143040_1

This change

shot_20250917_142959_1

TODO

  • Replicated in Generals

@xezon xezon added Bug Something is not working right, typically is user facing Minor Severity: Minor < Major < Critical < Blocker Gen Relates to Generals ZH Relates to Zero Hour Rendering Is Rendering related labels Sep 17, 2025
static Int drawEdgeX=0;
static Int drawEdgeY=0;
static Int drawStartX=0;
static Int drawStartY=0;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved these into the class.

if (m_trees[curTree].m_toppleState == TOPPLE_FALLING ||
m_trees[curTree].m_toppleState == TOPPLE_DOWN) {
continue;
}
m_shadow->setSize(m_treeTypes[type].m_shadowSize, -m_treeTypes[type].m_shadowSize*factor);
m_shadow->setSize(m_treeTypes[type].m_shadowSize, m_treeTypes[type].m_shadowSize);
Copy link
Author

@xezon xezon Sep 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change does not exactly relate to the fix, but is related to tree shadows. Essentially Y was flipped which should flip the texture, but that does not make a difference because the decal shadow is a dark circle and inconsequential to flipping.

Copy link

@Mauller Mauller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks Shady to me

@xezon xezon force-pushed the xezon/fix-tree-shadows branch from 978c3f4 to 367ad68 Compare September 20, 2025 17:22
@xezon xezon removed the Gen Relates to Generals label Sep 20, 2025
@xezon
Copy link
Author

xezon commented Sep 20, 2025

While replicating to Generals, I noticed that this issue does not happen in Generals, because Trees are not rendered through the W3DTreeBuffer. Looks like it was WIP from Generals to Zero Hour development and did not make the cut.

W3DTreeBuffer::W3DTreeBuffer(void)
{
	m_initialized = false;
	///@toto - reactivate this optimization if useful.  jba.
	return;
...

I replicated what can be replicated anyway and user facing it will change nothing in Generals.

@Mauller
Copy link

Mauller commented Sep 20, 2025

While replicating to Generals, I noticed that this issue does not happen in Generals, because Trees are not rendered through the W3DTreeBuffer. Looks like it was WIP from Generals to Zero Hour development and did not make the cut.

W3DTreeBuffer::W3DTreeBuffer(void)
{
	m_initialized = false;
	///@toto - reactivate this optimization if useful.  jba.
	return;
...

I replicated what can be replicated anyway and user facing it will change nothing in Generals.

When decoupling the tree sway from the render FPS i also noticed something similar.
The sway is implemented and handled in the tree buffer in zero hour.

@xezon xezon merged commit 9385483 into TheSuperHackers:main Sep 20, 2025
18 checks passed
@xezon xezon deleted the xezon/fix-tree-shadows branch September 20, 2025 17:52
fbraz3 pushed a commit to fbraz3/GeneralsX that referenced this pull request Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something is not working right, typically is user facing Minor Severity: Minor < Major < Critical < Blocker Rendering Is Rendering related ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Blob shadows pop in

2 participants