diff --git a/.changeset/quiet-jobs-end.md b/.changeset/quiet-jobs-end.md new file mode 100644 index 0000000..7e4d928 --- /dev/null +++ b/.changeset/quiet-jobs-end.md @@ -0,0 +1,5 @@ +--- +"@threejs-kit/instanced-sprite-mesh": patch +--- + +shader fix for flip diff --git a/packages/instanced-sprite-mesh/src/material.ts b/packages/instanced-sprite-mesh/src/material.ts index a5b1177..c30257c 100644 --- a/packages/instanced-sprite-mesh/src/material.ts +++ b/packages/instanced-sprite-mesh/src/material.ts @@ -161,10 +161,11 @@ export const constructSpriteMaterial = ( vec2 transformedPlaneUv = vUv + vec2(0.,0.); - if(flipX == 1.){ + // todo == 1. caused a flickering bug. look into Precision/interpolation? + if(flipX > 0.){ transformedPlaneUv.x = 1. - transformedPlaneUv.x; } - if(flipY == 1.){ + if(flipY > 0.){ transformedPlaneUv.y = 1. - transformedPlaneUv.y; }