From cf1674c423d1cb863ea623504ba9be8abc5f31c8 Mon Sep 17 00:00:00 2001 From: detomon Date: Fri, 28 Jul 2023 13:09:02 +0200 Subject: [PATCH] Initialize MSDF parameters in BaseMaterial3D with default (cherry picked from commit d275a7487d6728a490184971589f5e4854965466) --- doc/classes/BaseMaterial3D.xml | 2 +- scene/resources/material.cpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/classes/BaseMaterial3D.xml b/doc/classes/BaseMaterial3D.xml index f5e14e29bf2..c04de121491 100644 --- a/doc/classes/BaseMaterial3D.xml +++ b/doc/classes/BaseMaterial3D.xml @@ -269,7 +269,7 @@ Specifies the channel of the [member metallic_texture] in which the metallic information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored metallic in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use. - The width of the shape outine. + The width of the shape outline. The width of the range around the shape between the minimum and maximum representable signed distance. diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index a2aab8e7b45..8ebfd887700 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -2876,7 +2876,7 @@ void BaseMaterial3D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "proximity_fade_distance", PROPERTY_HINT_RANGE, "0,4096,0.01,suffix:m"), "set_proximity_fade_distance", "get_proximity_fade_distance"); ADD_GROUP("MSDF", "msdf_"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "msdf_pixel_range", PROPERTY_HINT_RANGE, "1,100,1"), "set_msdf_pixel_range", "get_msdf_pixel_range"); - ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "msdf_outline_size", PROPERTY_HINT_RANGE, "1,250,1"), "set_msdf_outline_size", "get_msdf_outline_size"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "msdf_outline_size", PROPERTY_HINT_RANGE, "0,250,1"), "set_msdf_outline_size", "get_msdf_outline_size"); ADD_GROUP("Distance Fade", "distance_fade_"); ADD_PROPERTY(PropertyInfo(Variant::INT, "distance_fade_mode", PROPERTY_HINT_ENUM, "Disabled,PixelAlpha,PixelDither,ObjectDither"), "set_distance_fade", "get_distance_fade"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "distance_fade_min_distance", PROPERTY_HINT_RANGE, "0,4096,0.01,suffix:m"), "set_distance_fade_min_distance", "get_distance_fade_min_distance"); @@ -3064,6 +3064,9 @@ BaseMaterial3D::BaseMaterial3D(bool p_orm) : set_grow(0.0); + set_msdf_pixel_range(4.0); + set_msdf_outline_size(0.0); + set_heightmap_deep_parallax_min_layers(8); set_heightmap_deep_parallax_max_layers(32); set_heightmap_deep_parallax_flip_tangent(false); //also sets binormal