diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-07-08 14:01:56 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-07-08 14:01:56 -0300 |
commit | e577c5b0705168177943fcdf9a0b66c1f8f864f3 (patch) | |
tree | ce5a473a273a0c8c209fd1b0b1c365449af9b689 /scene | |
parent | f4c8c552f956094e1bb8787de79476f57dd6a7b6 (diff) |
Some adjustments to toon material to make it more flexible
Ability to also disable specular
Diffstat (limited to 'scene')
-rw-r--r-- | scene/resources/material.cpp | 4 | ||||
-rw-r--r-- | scene/resources/material.h | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index 22c7744c84..705702b8be 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -325,6 +325,7 @@ void SpatialMaterial::_update_shader() { case SPECULAR_BLINN: code += ",specular_blinn"; break; case SPECULAR_PHONG: code += ",specular_phong"; break; case SPECULAR_TOON: code += ",specular_toon"; break; + case SPECULAR_DISABLED: code += ",specular_disabled"; break; } if (flags[FLAG_UNSHADED]) { @@ -1458,7 +1459,7 @@ void SpatialMaterial::_bind_methods() { ADD_GROUP("Parameters", "params_"); ADD_PROPERTY(PropertyInfo(Variant::INT, "params_diffuse_mode", PROPERTY_HINT_ENUM, "Lambert,Lambert Wrap,Oren Nayar,Burley,Toon"), "set_diffuse_mode", "get_diffuse_mode"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "params_specular_mode", PROPERTY_HINT_ENUM, "SchlickGGX,Blinn,Phong,Toon"), "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"); @@ -1621,6 +1622,7 @@ void SpatialMaterial::_bind_methods() { BIND_CONSTANT(SPECULAR_BLINN); BIND_CONSTANT(SPECULAR_PHONG); BIND_CONSTANT(SPECULAR_TOON); + BIND_CONSTANT(SPECULAR_DISABLED); BIND_CONSTANT(BILLBOARD_DISABLED); BIND_CONSTANT(BILLBOARD_ENABLED); diff --git a/scene/resources/material.h b/scene/resources/material.h index 1a9822a1c8..276064bce4 100644 --- a/scene/resources/material.h +++ b/scene/resources/material.h @@ -179,6 +179,7 @@ public: SPECULAR_BLINN, SPECULAR_PHONG, SPECULAR_TOON, + SPECULAR_DISABLED, }; enum BillboardMode { |