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

Initialize MSDF parameters in BaseMaterial3D with default #79983

Conversation

detomon
Copy link
Contributor

@detomon detomon commented Jul 28, 2023

This fixes the initialization of MSDF parameters in BaseMaterial3D when using the default values.

The problem seems to be that msdf_pixel_range will not be initialized when loading the material using its default value.
The left material is a StandardMaterial3D with a MSDF texture and albedo_texture_msdf enabled. The right material is the same but converted to a ShaderMaterial. When opening the scene, the left texture look blurry. When setting msdf_pixel_range of the StandardMaterial3D to another value than 4, it looks sharp.

msdf_standard_vs_shader

I also changed the minimum range value of msdf_outline_size to 0 which is the default according to the documentation.

Test project: msdf.zip

@detomon detomon requested a review from a team as a code owner July 28, 2023 12:49
@Calinou Calinou added bug topic:rendering topic:3d cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release labels Jul 28, 2023
@Calinou Calinou added this to the 4.2 milestone Jul 28, 2023
@clayjohn clayjohn merged commit 031aa99 into godotengine:master Jul 28, 2023
@clayjohn
Copy link
Member

Looks great! Thank you!

@detomon detomon deleted the initialize-msdf-parameters-in-base-material branch July 28, 2023 15:40
@YuriSizov YuriSizov removed the cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release label Oct 19, 2023
@YuriSizov
Copy link
Contributor

Cherry-picked for 4.1.3.

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.

4 participants