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

Replace textureSize() with a uniform in BaseMaterial3D for MSDF rendering #100280

Merged

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Dec 11, 2024

This uniform was already defined for other uses previously.

textureSize() is known to be slow on mobile platforms due to how the drivers implement it there, so it's best avoided.

…dering

This uniform was already defined for other uses previously.

`textureSize()` is known to be slow on mobile platforms due to how
the drivers implement it there, so it's best avoided.
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! Its nice that the albedo texture size is already available.

For posterity, the problem with textureSize() isn't a driver issue. On all platforms textureSize() does a full texture read which is much more expensive than just reading from a uniform.

@clayjohn clayjohn modified the milestones: 4.x, 4.4 Dec 11, 2024
@Repiteo Repiteo merged commit 4258008 into godotengine:master Dec 11, 2024
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Dec 11, 2024

Thanks!

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