summaryrefslogtreecommitdiff
path: root/scene/resources
diff options
context:
space:
mode:
authorJFonS <joan.fonssanchez@gmail.com>2018-04-23 11:14:16 +0200
committerJFonS <joan.fonssanchez@gmail.com>2018-04-23 11:14:16 +0200
commitaeda5dccfe3a895f09c851620dbf9f8ce01682b9 (patch)
tree401161178a87c859597aace50e5b85a733a4cd31 /scene/resources
parent1c419531a009f48aa074f9b5f93b98d387c33723 (diff)
Fix particle animation controls
Diffstat (limited to 'scene/resources')
-rw-r--r--scene/resources/material.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp
index a83ef198fb..3bd2f53908 100644
--- a/scene/resources/material.cpp
+++ b/scene/resources/material.cpp
@@ -550,7 +550,7 @@ void SpatialMaterial::_update_shader() {
//handle animation
code += "\tint particle_total_frames = particles_anim_h_frames * particles_anim_v_frames;\n";
- code += "\tint particle_frame = int(INSTANCE_CUSTOM.y * float(particle_total_frames));\n";
+ code += "\tint particle_frame = int(INSTANCE_CUSTOM.z * float(particle_total_frames));\n";
code += "\tif (particles_anim_loop) particle_frame=clamp(particle_frame,0,particle_total_frames-1); else particle_frame=abs(particle_frame)%particle_total_frames;\n";
code += "\tUV /= vec2(float(particles_anim_h_frames),float(particles_anim_v_frames));\n";
code += "\tUV += vec2(float(particle_frame % particles_anim_h_frames) / float(particles_anim_h_frames),float(particle_frame / particles_anim_h_frames) / float(particles_anim_v_frames));\n";