Skip to content

Commit

Permalink
Allow clearcoat, anisotropy and refraction in SpatialMaterial in GLES2
Browse files Browse the repository at this point in the history
These SpatialMaterial features work just fine in GLES2,
but they were not exposed in the inspector when GLES2 was used.
  • Loading branch information
Calinou committed Aug 22, 2021
1 parent 16642e2 commit 33d2328
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 3 additions & 3 deletions doc/classes/SpatialMaterial.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
</member>
<member name="refraction_enabled" type="bool" setter="set_feature" getter="get_feature" default="false">
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.
</member>
<member name="refraction_scale" type="float" setter="set_refraction" getter="get_refraction">
The strength of the refraction effect.
The strength of the refraction effect. Higher values result in a more distorted appearance for the refraction.
</member>
<member name="refraction_texture" type="Texture" setter="set_texture" getter="get_texture">
Texture that controls the strength of the refraction per-pixel. Multiplied by [member refraction_scale].
</member>
<member name="refraction_texture_channel" type="int" setter="set_refraction_texture_channel" getter="get_refraction_texture_channel" enum="SpatialMaterial.TextureChannel">
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.
</member>
<member name="rim" type="float" setter="set_rim" getter="get_rim">
Sets the strength of the rim lighting effect.
Expand Down
3 changes: 0 additions & 3 deletions scene/resources/material.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 33d2328

Please sign in to comment.