summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorBojidar Marinov <bojidar.marinov.bg@gmail.com>2018-10-28 20:19:46 +0200
committerBojidar Marinov <bojidar.marinov.bg@gmail.com>2018-10-28 20:19:46 +0200
commite4d316fcdcd8d0b0c93287c895fa52934636a0a7 (patch)
tree5e724f3abbd28bdbdbc18db92d0eba98b842e660 /scene
parentaeddb30fa38215acf8620238209cb53f5bddc28d (diff)
Fix particle frames being cut off after 0de8309b2c38306a2c05f8f239fa423bc1b7899b
Fixes #23178
Diffstat (limited to 'scene')
-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 274c74a9a2..c3030ee741 100644
--- a/scene/resources/material.cpp
+++ b/scene/resources/material.cpp
@@ -614,7 +614,7 @@ void SpatialMaterial::_update_shader() {
code += "\tfloat particle_frame = floor(INSTANCE_CUSTOM.z * float(particle_total_frames));\n";
code += "\tif (particles_anim_loop) particle_frame=clamp(particle_frame,0.0,particle_total_frames-1.0); else particle_frame=mod(particle_frame,float(particle_total_frames));\n";
code += "\tUV /= vec2(float(particles_anim_h_frames),float(particles_anim_v_frames));\n";
- code += "\tUV += vec2(mod(particle_frame,float(particles_anim_h_frames)) / float(particles_anim_h_frames),particle_frame / float(particles_anim_h_frames) / float(particles_anim_v_frames));\n";
+ code += "\tUV += vec2(mod(particle_frame,float(particles_anim_h_frames)) / float(particles_anim_h_frames), floor(particle_frame / float(particles_anim_h_frames)) / float(particles_anim_v_frames));\n";
} break;
}