diff options
-rw-r--r-- | doc/classes/SpatialMaterial.xml | 2 | ||||
-rw-r--r-- | drivers/gles3/shader_compiler_gles3.cpp | 2 | ||||
-rw-r--r-- | drivers/gles3/shaders/scene.glsl | 6 | ||||
-rw-r--r-- | scene/resources/material.cpp | 8 | ||||
-rw-r--r-- | scene/resources/material.h | 2 | ||||
-rw-r--r-- | servers/visual/shader_types.cpp | 2 |
6 files changed, 11 insertions, 11 deletions
diff --git a/doc/classes/SpatialMaterial.xml b/doc/classes/SpatialMaterial.xml index da89c37ff4..db47875050 100644 --- a/doc/classes/SpatialMaterial.xml +++ b/doc/classes/SpatialMaterial.xml @@ -1085,7 +1085,7 @@ </constant> <constant name="DIFFUSE_TOON" value="4"> </constant> - <constant name="SPECULAR_GGX" value="0"> + <constant name="SPECULAR_SCHLICK_GGX" value="0"> </constant> <constant name="SPECULAR_BLINN" value="1"> </constant> diff --git a/drivers/gles3/shader_compiler_gles3.cpp b/drivers/gles3/shader_compiler_gles3.cpp index 6c0e4f74ff..5fe7b53a7d 100644 --- a/drivers/gles3/shader_compiler_gles3.cpp +++ b/drivers/gles3/shader_compiler_gles3.cpp @@ -838,7 +838,7 @@ ShaderCompilerGLES3::ShaderCompilerGLES3() { actions[VS::SHADER_SPATIAL].render_mode_defines["diffuse_lambert_wrap"] = "#define DIFFUSE_LAMBERT_WRAP\n"; actions[VS::SHADER_SPATIAL].render_mode_defines["diffuse_toon"] = "#define DIFFUSE_TOON\n"; - actions[VS::SHADER_SPATIAL].render_mode_defines["specular_ggx"] = "#define SPECULAR_GGX\n"; + actions[VS::SHADER_SPATIAL].render_mode_defines["specular_schlick_ggx"] = "#define SPECULAR_SCHLICK_GGX\n"; actions[VS::SHADER_SPATIAL].render_mode_defines["specular_blinn"] = "#define SPECULAR_BLINN\n"; actions[VS::SHADER_SPATIAL].render_mode_defines["specular_phong"] = "#define SPECULAR_PHONG\n"; actions[VS::SHADER_SPATIAL].render_mode_defines["specular_toon"] = "#define SPECULAR_TOON\n"; diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl index bf0ebae3e3..e4d76753cb 100644 --- a/drivers/gles3/shaders/scene.glsl +++ b/drivers/gles3/shaders/scene.glsl @@ -1065,7 +1065,7 @@ LIGHT_SHADER_CODE #elif defined(SPECULAR_DISABLED) //none.. -#elif defined(SPECULAR_GGX) +#elif defined(SPECULAR_SCHLICK_GGX) // shlick+ggx as default vec3 H = normalize(V + L); @@ -1102,10 +1102,10 @@ LIGHT_SHADER_CODE #if defined(LIGHT_USE_CLEARCOAT) if (clearcoat_gloss > 0.0) { -# if !defined(SPECULAR_GGX) && !defined(SPECULAR_BLINN) +# if !defined(SPECULAR_SCHLICK_GGX) && !defined(SPECULAR_BLINN) vec3 H = normalize(V + L); # endif -# if !defined(SPECULAR_GGX) +# if !defined(SPECULAR_SCHLICK_GGX) float cNdotH = max(dot(N,H), 0.0); float cLdotH = max(dot(L,H), 0.0); float cLdotH5 = SchlickFresnel(cLdotH); diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index b22a019319..898a594498 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -377,7 +377,7 @@ void SpatialMaterial::_update_shader() { case DIFFUSE_TOON: code += ",diffuse_toon"; break; } switch (specular_mode) { - case SPECULAR_GGX: code += ",specular_ggx"; break; + case SPECULAR_SCHLICK_GGX: code += ",specular_schlick_ggx"; break; case SPECULAR_BLINN: code += ",specular_blinn"; break; case SPECULAR_PHONG: code += ",specular_phong"; break; case SPECULAR_TOON: code += ",specular_toon"; break; @@ -1819,7 +1819,7 @@ void SpatialMaterial::_bind_methods() { ADD_GROUP("Parameters", "params_"); ADD_PROPERTY(PropertyInfo(Variant::INT, "params_diffuse_mode", PROPERTY_HINT_ENUM, "Burley,Lambert,Lambert Wrap,Oren Nayar,Toon"), "set_diffuse_mode", "get_diffuse_mode"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "params_specular_mode", PROPERTY_HINT_ENUM, "GGX,Blinn,Phong,Toon,Disabled"), "set_specular_mode", "get_specular_mode"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "params_specular_mode", PROPERTY_HINT_ENUM, "SchlickGGX,Blinn,Phong,Toon,Disabled"), "set_specular_mode", "get_specular_mode"); ADD_PROPERTY(PropertyInfo(Variant::INT, "params_blend_mode", PROPERTY_HINT_ENUM, "Mix,Add,Sub,Mul"), "set_blend_mode", "get_blend_mode"); ADD_PROPERTY(PropertyInfo(Variant::INT, "params_cull_mode", PROPERTY_HINT_ENUM, "Back,Front,Disabled"), "set_cull_mode", "get_cull_mode"); ADD_PROPERTY(PropertyInfo(Variant::INT, "params_depth_draw_mode", PROPERTY_HINT_ENUM, "Opaque Only,Always,Never,Opaque Pre-Pass"), "set_depth_draw_mode", "get_depth_draw_mode"); @@ -2006,7 +2006,7 @@ void SpatialMaterial::_bind_methods() { BIND_ENUM_CONSTANT(DIFFUSE_OREN_NAYAR); BIND_ENUM_CONSTANT(DIFFUSE_TOON); - BIND_ENUM_CONSTANT(SPECULAR_GGX); + BIND_ENUM_CONSTANT(SPECULAR_SCHLICK_GGX); BIND_ENUM_CONSTANT(SPECULAR_BLINN); BIND_ENUM_CONSTANT(SPECULAR_PHONG); BIND_ENUM_CONSTANT(SPECULAR_TOON); @@ -2087,7 +2087,7 @@ SpatialMaterial::SpatialMaterial() flags[i] = 0; } diffuse_mode = DIFFUSE_LAMBERT; - specular_mode = SPECULAR_GGX; + specular_mode = SPECULAR_SCHLICK_GGX; for (int i = 0; i < FEATURE_MAX; i++) { features[i] = false; diff --git a/scene/resources/material.h b/scene/resources/material.h index 942fb42363..2425f1a174 100644 --- a/scene/resources/material.h +++ b/scene/resources/material.h @@ -193,7 +193,7 @@ public: }; enum SpecularMode { - SPECULAR_GGX, + SPECULAR_SCHLICK_GGX, SPECULAR_BLINN, SPECULAR_PHONG, SPECULAR_TOON, diff --git a/servers/visual/shader_types.cpp b/servers/visual/shader_types.cpp index bd8a67c0a3..7489ca7e3e 100644 --- a/servers/visual/shader_types.cpp +++ b/servers/visual/shader_types.cpp @@ -159,7 +159,7 @@ ShaderTypes::ShaderTypes() { shader_modes[VS::SHADER_SPATIAL].modes.insert("diffuse_burley"); shader_modes[VS::SHADER_SPATIAL].modes.insert("diffuse_toon"); - shader_modes[VS::SHADER_SPATIAL].modes.insert("specular_ggx"); + shader_modes[VS::SHADER_SPATIAL].modes.insert("specular_schlick_ggx"); shader_modes[VS::SHADER_SPATIAL].modes.insert("specular_blinn"); shader_modes[VS::SHADER_SPATIAL].modes.insert("specular_phong"); shader_modes[VS::SHADER_SPATIAL].modes.insert("specular_toon"); |