Merge pull request #25659 from JFonS/fix_25567

Fix particles animation on GLES2
This commit is contained in:
Rémi Verschelde 2019-02-06 18:40:35 +01:00 committed by GitHub
commit 4b6327fb30
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -134,7 +134,7 @@ void CanvasItemMaterial::_update_shader() {
code += "\tint total_frames = particles_anim_h_frames * particles_anim_v_frames;\n";
code += "\tint frame = int(float(total_frames) * INSTANCE_CUSTOM.z);\n";
code += "\tif (particles_anim_loop) {\n";
code += "\t\tframe = abs(frame) % total_frames;\n";
code += "\t\tframe = int(abs(frame) % total_frames);\n";
code += "\t} else {\n";
code += "\t\tframe = clamp(frame, 0, total_frames - 1);\n";
code += "\t}\n";