aboutsummaryrefslogtreecommitdiff
path: root/scene/resources/material.cpp
diff options
context:
space:
mode:
authorJuan Linietsky2017-05-29 22:11:33 -0300
committerJuan Linietsky2017-05-30 08:56:19 -0300
commit5567e898d1052c1e2c2d32d3c37dfd957f4dc4bd (patch)
treee0df9b88b6c485f846dab9ae51369288f191cab8 /scene/resources/material.cpp
parent0a6faeb4f5914061c29d946eaa29f2c50b8472fb (diff)
downloadgodot-5567e898d1052c1e2c2d32d3c37dfd957f4dc4bd.tar.gz
godot-5567e898d1052c1e2c2d32d3c37dfd957f4dc4bd.tar.zst
godot-5567e898d1052c1e2c2d32d3c37dfd957f4dc4bd.zip
Several fixes related to PBR and Environment
Diffstat (limited to '')
-rw-r--r--scene/resources/material.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp
index 48299d566..d1713eb15 100644
--- a/scene/resources/material.cpp
+++ b/scene/resources/material.cpp
@@ -510,7 +510,7 @@ void SpatialMaterial::_update_shader() {
} else {
code += "\tvec4 specular_tex = texture(texture_specular,UV);\n";
code += "\tSPECULAR = vec3(ALBEDO.rgb * metalness * specular_tex.r);\n";
- code += "\tROUGHNESS = specular_tex.a * roughness;\n";
+ code += "\tROUGHNESS = specular_tex.g * roughness;\n";
}
code += "}\n";
@@ -888,10 +888,10 @@ void SpatialMaterial::_validate_property(PropertyInfo &property) const {
_validate_feature("refraction", FEATURE_REFRACTION, property);
_validate_feature("detail", FEATURE_DETAIL, property);
- if (property.name == "specular/color" && specular_mode == SPECULAR_MODE_METALLIC) {
+ if (property.name == "specular_color" && specular_mode == SPECULAR_MODE_METALLIC) {
property.usage = 0;
}
- if (property.name == "specular/metalness" && specular_mode == SPECULAR_MODE_SPECULAR) {
+ if (property.name == "specular_metalness" && specular_mode == SPECULAR_MODE_SPECULAR) {
property.usage = 0;
}