summaryrefslogtreecommitdiff
path: root/scene/resources
diff options
context:
space:
mode:
authorRaffaele Picca <picster@pixelgod.net>2021-11-15 13:07:42 +0100
committerRaffaele Picca <picster@pixelgod.net>2021-11-26 01:12:23 +0100
commit459e2a4b6f45b19f50e8a493e12e0f442a14a826 (patch)
tree098dbbd9021eadaaf1e710807b6ef8e67726d3d1 /scene/resources
parentdd10213d6ed24e834fc6f7ee8c16b9b84840c368 (diff)
Fixed texture animation speed when using random lifetime ( Particle2D gpu + cpu) as mentioned here: https://github.com/godotengine/godot/issues/54993
Diffstat (limited to 'scene/resources')
-rw-r--r--scene/resources/particles_material.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/resources/particles_material.cpp b/scene/resources/particles_material.cpp
index e77f5a0be7..5ceb90d511 100644
--- a/scene/resources/particles_material.cpp
+++ b/scene/resources/particles_material.cpp
@@ -584,7 +584,7 @@ void ParticlesMaterial::_update_shader() {
code += " float base_angle = (tex_angle) * mix(initial_angle_min, initial_angle_max, rand_from_seed(alt_seed));\n";
code += " base_angle += CUSTOM.y * LIFETIME * (tex_angular_velocity) * mix(angular_velocity_min,angular_velocity_max, rand_from_seed(alt_seed));\n";
code += " CUSTOM.x = base_angle * degree_to_rad;\n"; // angle
- code += " CUSTOM.z = (tex_anim_offset) * mix(anim_offset_min, anim_offset_max, rand_from_seed(alt_seed)) + CUSTOM.y * tex_anim_speed * mix(anim_speed_min, anim_speed_max, rand_from_seed(alt_seed));\n"; // angle
+ code += " CUSTOM.z = (tex_anim_offset) * mix(anim_offset_min, anim_offset_max, rand_from_seed(alt_seed)) + tv * tex_anim_speed * mix(anim_speed_min, anim_speed_max, rand_from_seed(alt_seed));\n"; // angle
// apply color
// apply hue rotation