I need a material for a cylinder with rings of icons. The cylinder only has the walls and will have three rings, each with a tiled icon around it. The icons are square, which helps. I have the cylinder UV set for 1-0 and a base material with Mask-G->Multiply*3->Floor->IF node comparing to 1 with A<B being first ring, A=B, for second, and A>B for third ring. I am trying with only base textures to test instead of atlas, but I cannot seem to get the icons to tile only in the single band cleanly.
the fix is to stop sampling the texture first and comparing after. instead build a second set of UVs that already lives inside the band, then sample once. the IF/Floor chain on mask G is fine as a band selector, but your texture sample should use remapped coordinates:
for each ring with V range [v0, v1]
- band V: remap = saturate((Mask.G - v0) / (v1 - v0)) so the band spans 0-1 cleanly.
- ring U: frac(U * iconCount) with iconCount the number of icons around the cylinder, so each icon gets an isolated 0-1 tile.
-
- sample the icon texture with (ringU, bandV).
- then combine the three rings: three samples each with their own v0/v1, lerp or If-select between them using your existing band mask. if all three rings share one icon texture this collapses to one sample; if the icons live stacked in one atlas, offset V by bandIndex: final V = (bandIndex + bandV) / 3.
two gotchas that make bands look dirty:
- mip bleeding at band edges: the GPU blends mips across the V boundary and you get ghosting between rings. either add a small epsilon inset on v0/v1, or split the atlas into separate textures per ring, or clamp mip level.
-
- CylinderUVs vs regular UVs: make sure the tiling happens in the same UV space your cylinder actually uses. if the mesh UVs are 0-1 around, frac(U * iconCount) is right; if you are using cylindrical mapping in the material, apply the frac after that mapping.
- once the remap is in, the icons tile inside their band and nowhere else.