Explorar el Código

Merge pull request #23360 from bojidar-bg/23178-fix-particles-animation

Fix particle frames being cut off
Rémi Verschelde hace 6 años
padre
commit
db937abf72
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      scene/resources/material.cpp

+ 1 - 1
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;
 	}