Skip to content

Commit a66c7d8

Browse files
authored
Fixed Tiler node offset for odd rows (contributed by DevFika)
Fix "Tiler" offset for odd rows
2 parents 3be9fa2 + b2a832b commit a66c7d8

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

addons/material_maker/nodes/tiler.mmg

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@
5858
"\t\t\tvec2 pos = uv*tile+vec2(float(dx), float(dy)); pos = fract((floor(mod(pos, tile))+vec2(0.5))/tile)-vec2(0.5);",
5959
"\t\t\tvec2 seed = rand2(pos+_seed);",
6060
"\t\t\trc1 = rand3(seed);",
61-
"\t\t\tpos = fract(pos+vec2($fixed_offset/tile.x, 0.0)*floor(mod(pos.y*tile.y, 2.0))+$offset*seed/tile);",
61+
"\t\t\tvec2 tile_index = floor(uv * tile) + vec2(float(dx), float(dy));",
62+
"\t\t\tpos += vec2(($fixed_offset/tile.x)*mod(mod(tile_index.y, tile.y), 2.0), 0.0)+$offset*seed/tile;",
6263
"\t\t\tfloat mask = $mask(fract(pos+vec2(0.5)));",
6364
"\t\t\tif (mask > 0.01) {",
6465
"\t\t\t\tvec2 pv = fract(uv - pos)-vec2(0.5);",

0 commit comments

Comments
 (0)