You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-11 13:10:58 +00:00
Added flag on SpatialMaterial to disable shadows
This commit is contained in:
@@ -387,10 +387,12 @@ void SpatialMaterial::_update_shader() {
|
||||
if (flags[FLAG_USE_VERTEX_LIGHTING]) {
|
||||
code += ",vertex_lighting";
|
||||
}
|
||||
|
||||
if (flags[FLAG_TRIPLANAR_USE_WORLD] && (flags[FLAG_UV1_USE_TRIPLANAR] || flags[FLAG_UV2_USE_TRIPLANAR])) {
|
||||
code += ",world_vertex_coords";
|
||||
}
|
||||
if (flags[FLAG_DONT_RECEIVE_SHADOWS]) {
|
||||
code += ",shadows_disabled";
|
||||
}
|
||||
code += ";\n";
|
||||
|
||||
code += "uniform vec4 albedo : hint_color;\n";
|
||||
@@ -1849,6 +1851,7 @@ void SpatialMaterial::_bind_methods() {
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "flags_world_triplanar"), "set_flag", "get_flag", FLAG_TRIPLANAR_USE_WORLD);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "flags_fixed_size"), "set_flag", "get_flag", FLAG_FIXED_SIZE);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "flags_albedo_tex_force_srgb"), "set_flag", "get_flag", FLAG_ALBEDO_TEXTURE_FORCE_SRGB);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "flags_do_not_receive_shadows"), "set_flag", "get_flag", FLAG_DONT_RECEIVE_SHADOWS);
|
||||
ADD_GROUP("Vertex Color", "vertex_color");
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "vertex_color_use_as_albedo"), "set_flag", "get_flag", FLAG_ALBEDO_FROM_VERTEX_COLOR);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "vertex_color_is_srgb"), "set_flag", "get_flag", FLAG_SRGB_VERTEX_COLOR);
|
||||
@@ -2038,6 +2041,7 @@ void SpatialMaterial::_bind_methods() {
|
||||
BIND_ENUM_CONSTANT(FLAG_USE_ALPHA_SCISSOR);
|
||||
BIND_ENUM_CONSTANT(FLAG_TRIPLANAR_USE_WORLD);
|
||||
BIND_ENUM_CONSTANT(FLAG_ALBEDO_TEXTURE_FORCE_SRGB);
|
||||
BIND_ENUM_CONSTANT(FLAG_DONT_RECEIVE_SHADOWS);
|
||||
BIND_ENUM_CONSTANT(FLAG_MAX);
|
||||
|
||||
BIND_ENUM_CONSTANT(DIFFUSE_BURLEY);
|
||||
|
||||
Reference in New Issue
Block a user