diff options
author | detomon <simon@monoxid.ch> | 2023-07-28 13:09:02 +0200 |
---|---|---|
committer | detomon <simon@monoxid.ch> | 2023-07-28 13:24:44 +0200 |
commit | d275a7487d6728a490184971589f5e4854965466 (patch) | |
tree | 8d8e8b1fa4d46286b6d80d1797cb21183552ca1b | |
parent | da81ca62a5f6d615516929896caa0b6b09ceccfc (diff) | |
download | redot-engine-d275a7487d6728a490184971589f5e4854965466.tar.gz |
Initialize MSDF parameters in BaseMaterial3D with default
-rw-r--r-- | doc/classes/BaseMaterial3D.xml | 2 | ||||
-rw-r--r-- | 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 86cc86c752..949dcc24d0 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. </member> <member name="msdf_outline_size" type="float" setter="set_msdf_outline_size" getter="get_msdf_outline_size" default="0.0"> - The width of the shape outine. + The width of the shape outline. </member> <member name="msdf_pixel_range" type="float" setter="set_msdf_pixel_range" getter="get_msdf_pixel_range" default="4.0"> 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 d3ef4a303b..65da0bc3c8 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 |