Skip to content

Commit

Permalink
flip shader fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jerzakm committed Feb 2, 2024
1 parent 2de01f0 commit 5ef119f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/quiet-jobs-end.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@threejs-kit/instanced-sprite-mesh": patch
---

shader fix for flip
5 changes: 3 additions & 2 deletions packages/instanced-sprite-mesh/src/material.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 5ef119f

Please sign in to comment.