diff options
Diffstat (limited to 'scene/3d/particles.cpp')
-rw-r--r-- | scene/3d/particles.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scene/3d/particles.cpp b/scene/3d/particles.cpp index 2a032f5d96..f8685a7b7c 100644 --- a/scene/3d/particles.cpp +++ b/scene/3d/particles.cpp @@ -869,6 +869,7 @@ void ParticlesMaterial::_update_shader() { } //scale by scale code += " float base_scale = mix(scale*tex_scale,1.0,scale_random*scale_rand);\n"; + code += " if (base_scale==0.0) base_scale=0.000001;\n"; if (trail_size_modifier.is_valid()) { code += " if (trail_divisor > 1) { base_scale *= textureLod(trail_size_modifier,vec2(float(int(NUMBER)%trail_divisor)/float(trail_divisor-1),0.0),0.0).r; } \n"; } @@ -1360,6 +1361,11 @@ void ParticlesMaterial::_validate_property(PropertyInfo &property) const { } } +Shader::Mode ParticlesMaterial::get_shader_mode() const { + + return Shader::MODE_PARTICLES; +} + void ParticlesMaterial::_bind_methods() { ClassDB::bind_method(D_METHOD("set_spread", "degrees"), &ParticlesMaterial::set_spread); |