From 33d23281cb784a872826e79462717dc41817403e Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Sun, 22 Aug 2021 01:43:27 +0200 Subject: [PATCH] Allow clearcoat, anisotropy and refraction in SpatialMaterial in GLES2 These SpatialMaterial features work just fine in GLES2, but they were not exposed in the inspector when GLES2 was used. --- doc/classes/SpatialMaterial.xml | 6 +++--- scene/resources/material.cpp | 3 --- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/doc/classes/SpatialMaterial.xml b/doc/classes/SpatialMaterial.xml index aace5d7542ad..4627160b6123 100644 --- a/doc/classes/SpatialMaterial.xml +++ b/doc/classes/SpatialMaterial.xml @@ -290,16 +290,16 @@ If [code]true[/code], the proximity fade effect is enabled. The proximity fade effect fades out each pixel based on its distance to another object. - If [code]true[/code], the refraction effect is enabled. Distorts transparency based on light from behind the object. + If [code]true[/code], the refraction effect is enabled. Refraction distorts transparency based on light from behind the object. When using the GLES3 backend, the material's roughness value will affect the blurriness of the refraction. Higher roughness values will make the refraction look blurrier. - The strength of the refraction effect. + The strength of the refraction effect. Higher values result in a more distorted appearance for the refraction. Texture that controls the strength of the refraction per-pixel. Multiplied by [member refraction_scale]. - Specifies the channel of the [member ao_texture] in which the ambient occlusion 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. + Specifies the channel of the [member refraction_texture] in which the refraction 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. Sets the strength of the rim lighting effect. diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index 9c997c1633c2..36c56847e220 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -1402,10 +1402,7 @@ void SpatialMaterial::_validate_property(PropertyInfo &property) const { _validate_feature("refraction", FEATURE_REFRACTION, property); _validate_feature("detail", FEATURE_DETAIL, property); - _validate_high_end("refraction", property); _validate_high_end("subsurf_scatter", property); - _validate_high_end("anisotropy", property); - _validate_high_end("clearcoat", property); _validate_high_end("depth", property); if (property.name.begins_with("particles_anim_") && billboard_mode != BILLBOARD_PARTICLES) {