summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2018-05-08 11:34:34 -0300
committerGitHub <noreply@github.com>2018-05-08 11:34:34 -0300
commitaacd7f012ebcfb7f8023ebecba2e003fcd018e98 (patch)
tree0d054fd09dff3e7b8d69e110d382d9f112b76e77
parentb190afe0847cef449b094469ad50b0c8e3ca1350 (diff)
parentaeda5dccfe3a895f09c851620dbf9f8ce01682b9 (diff)
Merge pull request #18374 from JFonS/fix_particles_animation
Fix particle animation controls
-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 1282ce767a..5e7569586a 100644
--- a/scene/resources/material.cpp
+++ b/scene/resources/material.cpp
@@ -552,7 +552,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";