base
This commit is contained in:
@@ -29,7 +29,8 @@ vec2 SurfaceUV()
|
||||
{
|
||||
if (uvMode == 0) return aTex + uvOffset;
|
||||
|
||||
vec3 n = abs(aNormal);
|
||||
// Unscale the normal first, so a stretched mesh picks the axis it faces in the world
|
||||
vec3 n = abs(aNormal / max(tileScale, vec3(1e-4)));
|
||||
vec3 p = aPos * tileScale;
|
||||
if (n.y >= n.x && n.y >= n.z) return p.xz + uvOffset;
|
||||
if (n.x >= n.z) return p.zy + uvOffset;
|
||||
|
||||
Reference in New Issue
Block a user