diff options
Diffstat (limited to 'scene/resources/material.cpp')
-rw-r--r-- | scene/resources/material.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index 15710f4c14..c8ab7c2a04 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -215,6 +215,13 @@ bool ShaderMaterial::_can_do_next_pass() const { return shader.is_valid() && shader->get_mode() == Shader::MODE_SPATIAL; } +Shader::Mode ShaderMaterial::get_shader_mode() const { + if (shader.is_valid()) + return shader->get_mode(); + else + return Shader::MODE_SPATIAL; +} + ShaderMaterial::ShaderMaterial() { } @@ -1662,6 +1669,11 @@ RID SpatialMaterial::get_shader_rid() const { return shader_map[current_key].shader; } +Shader::Mode SpatialMaterial::get_shader_mode() const { + + return Shader::MODE_SPATIAL; +} + void SpatialMaterial::_bind_methods() { ClassDB::bind_method(D_METHOD("set_albedo", "albedo"), &SpatialMaterial::set_albedo); @@ -2054,8 +2066,8 @@ void SpatialMaterial::_bind_methods() { BIND_ENUM_CONSTANT(EMISSION_OP_MULTIPLY); } -SpatialMaterial::SpatialMaterial() - : element(this) { +SpatialMaterial::SpatialMaterial() : + element(this) { //initialize to right values set_albedo(Color(1.0, 1.0, 1.0, 1.0)); |