From a7a21bd9fe72052e117a71f9934b9acae038d962 Mon Sep 17 00:00:00 2001 From: JFonS Date: Wed, 6 Feb 2019 16:00:22 +0100 Subject: Fix particles animation on GLES2 --- scene/2d/canvas_item.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scene') diff --git a/scene/2d/canvas_item.cpp b/scene/2d/canvas_item.cpp index dced688899..41cee7335e 100644 --- a/scene/2d/canvas_item.cpp +++ b/scene/2d/canvas_item.cpp @@ -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"; -- cgit v1.2.3