Shader experiment of the day:
When hex tiling is used to hide texture repetition, the coordinates are usually rotated per tile. That works great for chaotic surfaces without a noticeable directionality, but doesn't work for textures where the orientation matters. So I added a switch to just offset the coordinates randomly instead of rotating them. And for brick walls, tiles, etc, there is the option to use stepped offsets, so that the tiles are still aligned to the same grid:
#gamedev #Unreal
For reference: This is the same material but without the stepping applied to the coordinate offsets. As a result, the lines between the tiles don't line up anymore
This implementation is inspired by a Siggraph 2011 talk called 'Real-time Image Quilting: Arbitrary Material Blends, Invisible Seams, and No Repeats' by Hugh Malan. The only difference is that the implementation presented in the talk uses per-vertex data to define the splats, while I use hexagonal pattern mapped in world space.
https://advances.realtimerendering.com/s2011/index.html
@haukethiessen Am I right to assume that this would also work using UV coordinates instead of world space XY?
@lumpn Yes, wouldn't make a difference

I finally found the time to write a tutorial on how to implement this hexagonal tiling material:
https://www.artstation.com/blogs/haukethiessen/BPb7/cheap-hex-tiling-for-every-occasion
The two most interesting aspects that I haven't seen described anywhere else:
- use of dithered UVs instead of sampling textures multiple times
- stepped offsets instead of rotation for grid-like surfaces like brick walls, etc.

#gamedev #Unreal #shader #TechnicalArt

@haukethiessen Dithered UVs instead of sampling? Can I introduce you to some of the very very first GPUs? They used this trick as well. It doesn't work quite so convincingly at 320x240 and 30fps... :-)
@TomF I knew I wasn't the one who invented that trick, but I wasn't aware it's that old😅
Are there any specific games that used this technique at this resolution? I would really like to see that, but my personal gaming history started when 800x600 was the standard
@haukethiessen Dithering colour interpolators in SW was very common. I don't remember too many things dithering UVs because it was such a small window of time (1 year? 2?) before we had fast enough GPUs to actually do the lerps properly.
@haukethiessen That looks great. And it doesn’t cost too much in terms of ALU ?
@nick It depends. I'm using dithering for the UVs, so I only have to sample each texture once. Without this optimization, you need to sample each texture 3 times, so in combination with several layers or parallax mapping, this can become costly. The dithering can be noticeable, depending on how contrasty the texture is