From 5567e898d1052c1e2c2d32d3c37dfd957f4dc4bd Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 29 May 2017 22:11:33 -0300 Subject: Several fixes related to PBR and Environment --- scene/resources/material.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scene/resources/material.cpp') 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; } -- cgit v1.2.3-70-g09d2