Monday, March 9, 2026

How do I do world-space UV tiling at unfavourable coordinates within the unity shader graph?


I’m engaged on a Unity URP shader graph for a 2nd sport that does a tiled flip-book animation in world-space, in order that the objects it applies to by no means seem off-grid. the sport is a tile map platformer that depends on the one meter unit grid all over the place, so this shader is supposed for a selected artwork asset (the geometry of which is generated at runtime) that requires this flip-book animation. I’ve gotten it to work completely, so long as the place on the generated mesh is in constructive x and y world coordinates. Nonetheless, as quickly as any a part of it’s at unfavourable world coordinates, the flip-book animation begins to jitter round and stretch weirdly each couple seconds or so, amongst different incorrect UV stuff I cant describe. I’m utilizing a modulo to repeat the UV each one meter unit, so it is sensible that the offset generated by the flip-book node would behave surprisingly at unfavourable coordinates. That is a unfavourable modulo factor, which I’ve heard causes points like this, and I’ve visually confirmed that the UV ceases to appropriately repeat itself at unfavourable coordinates by quickly outputting the UV because the diffuse texture.

That is the related a part of my shader setup because it at the moment stands:
How do I do world-space UV tiling at unfavourable coordinates within the unity shader graph?

This can be a screenshot of some geometry generated with the debug view turned on:
generated geometry, clearly showcasing the correct behavior in positive coordinates, and incorrect behavior in negative coordinates to the left and below the zero position

As you may have the ability to inform, the maths does not work out appropriately at unfavourable coordinates, which is the essence of my subject. (The depicted sq. is centered on the zero coordinate on each axis.)

How can I obtain the identical impact in unfavourable coordinates (backside and left of zero), that I’ve achieved solely in constructive coordinates (above and to the fitting of zero)?

In essence, I simply have to generate an infinitely tiled UV in world-space that repeats each one unit, with out having issues at unfavourable coordinates.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisement -spot_img

Latest Articles