diff options
| author | Juan Linietsky | 2017-09-05 20:40:50 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2017-09-05 20:40:50 -0300 |
| commit | 308a6f4f99a5204682a2612d097e5c066f88196f (patch) | |
| tree | 5ca07300816c5e85b28fc1d03dcc9a428c54d8d3 /scene/resources/material.cpp | |
| parent | f5c5d07f9c5c387293a6df543fd5a428800e48f9 (diff) | |
| download | godot-308a6f4f99a5204682a2612d097e5c066f88196f.tar.gz godot-308a6f4f99a5204682a2612d097e5c066f88196f.tar.zst godot-308a6f4f99a5204682a2612d097e5c066f88196f.zip | |
Diffstat (limited to 'scene/resources/material.cpp')
| -rw-r--r-- | scene/resources/material.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index 3d6a10ffc..a187692bc 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -65,6 +65,12 @@ RID Material::get_rid() const { return material; } +void Material::_validate_property(PropertyInfo &property) const { + + if (!_can_do_next_pass() && property.name=="next_pass") { + property.usage=0; + } +} void Material::_bind_methods() { @@ -204,6 +210,11 @@ void ShaderMaterial::get_argument_options(const StringName &p_function, int p_id Resource::get_argument_options(p_function, p_idx, r_options); } +bool ShaderMaterial::_can_do_next_pass() const { + + return shader.is_valid() && shader->get_mode()==Shader::MODE_SPATIAL; +} + ShaderMaterial::ShaderMaterial() { } |
