Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a shared copy of placeholder textures, tweak placeholder appearance #98294

Merged

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Oct 18, 2024

This reduces memory usage a bit in case multiple placeholders were requested, e.g. when using multiple NoiseTextures with no noise property defined. This addresses a longstanding TODO in the codebase.

The placeholder texture's appearance was also changed from a plain magenta color to a checkerboard alternating between magenta and black pixels. This makes it easier to spot when the placeholder texture ends up being used in a complex scene (very likely by accident). The texture's dimensions remain identical to keep the physical size identical in 2D.

Preview

Decals and a FogVolume with a FogMaterial that uses an uninitialized NoiseTexture density map:

image

@Calinou Calinou requested a review from a team as a code owner October 18, 2024 12:30
@Calinou Calinou force-pushed the texture-placeholders-use-shared-copy branch from d3f9466 to 59e81d7 Compare October 18, 2024 12:31
@Calinou Calinou changed the title Use a shared copy of placeholder textures Use a shared copy of placeholder textures, tweak placeholder appearance Oct 18, 2024
@Calinou Calinou added this to the 4.4 milestone Oct 18, 2024
@Calinou Calinou force-pushed the texture-placeholders-use-shared-copy branch from 59e81d7 to 547d69a Compare October 18, 2024 12:49
@Calinou Calinou requested a review from a team as a code owner October 18, 2024 12:49
This reduces memory usage a bit in case multiple placeholders were
requested, e.g. when using multiple NoiseTextures with no noise property
defined.

The placeholder texture's appearance was also changed from a plain magenta
color to a checkerboard alternating between magenta and black pixels.
This makes it easier to spot when the placeholder texture ends up
being used in a complex scene (usually by accident).
The texture's dimensions remain identical to keep the physical size
identical in 2D.
@Calinou Calinou force-pushed the texture-placeholders-use-shared-copy branch from 547d69a to 35a20fa Compare October 18, 2024 12:51
Copy link
Member

@clayjohn clayjohn left a comment

Choose a reason for hiding this comment

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

Looks great! That comment has been their so long I've trained my eye to just fully ignore it haha

@Repiteo Repiteo merged commit 7815ccb into godotengine:master Oct 21, 2024
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Oct 21, 2024

Thanks!

@Calinou Calinou deleted the texture-placeholders-use-shared-copy branch October 22, 2024 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants