Add half frame to floor()
This commit is contained in:
parent
69b2f1dcc6
commit
edcb7b8129
2 changed files with 2 additions and 2 deletions
|
@ -148,7 +148,7 @@ void CanvasItemMaterial::_update_shader() {
|
|||
code += "\t\tparticle_frame = mod(particle_frame, particle_total_frames);\n";
|
||||
code += "\t}";
|
||||
code += "\tUV /= vec2(h_frames, v_frames);\n";
|
||||
code += "\tUV += vec2(mod(particle_frame, h_frames) / h_frames, floor(particle_frame / h_frames) / v_frames);\n";
|
||||
code += "\tUV += vec2(mod(particle_frame, h_frames) / h_frames, floor((particle_frame + 0.5) / h_frames) / v_frames);\n";
|
||||
code += "}\n";
|
||||
}
|
||||
|
||||
|
|
|
@ -672,7 +672,7 @@ void SpatialMaterial::_update_shader() {
|
|||
code += "\t\tparticle_frame = mod(particle_frame, particle_total_frames);\n";
|
||||
code += "\t}";
|
||||
code += "\tUV /= vec2(h_frames, v_frames);\n";
|
||||
code += "\tUV += vec2(mod(particle_frame, h_frames) / h_frames, floor(particle_frame / h_frames) / v_frames);\n";
|
||||
code += "\tUV += vec2(mod(particle_frame, h_frames) / h_frames, floor((particle_frame + 0.5) / h_frames) / v_frames);\n";
|
||||
} break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue