TilingRandomization/README.md

24 строки
980 B
Markdown
Исходник Постоянная ссылка Обычный вид История

2020-09-08 18:21:38 +03:00
# Tiling Randomization
2020-09-08 18:19:25 +03:00
Randomized Tiling for Unity ShaderGraph
2020-09-08 18:21:38 +03:00
Works with: 2019.4 LTS, 2020.1, 2020.2
Get rid of tiling artifacts in your shaders by randomizing the tiling.
2020-09-08 21:00:36 +03:00
![Before: Standard Tiling](/.images/TilingRandomizationBefore.jpg)
![After: Randomized Tiling](/.images/TilingRandomizationAfter.jpg)
2020-09-09 21:41:07 +03:00
How it's done:
Split the UV plane into three groups of hexagons, here colored red, green and blue.
![Hexes: Tiling Regions](/.images/TilingRandomizationHexes.jpg)
Each hexagon chooses a unique randomized tiling.
Here we display the random values of each hex tile.
![Random: Per-Tile Random Values](/.images/TilingRandomizationValue.jpg)
We blend the hexagons together.
Any pixel fragment only has to consider three neighboring hexagons, one from each of the three groups.
The relative cost, compared to a regular tiling texture fetch, is is a bit of math (which is largely "free" on modern GPUs) and three texture fetches, one for each of the neighboring hexagons.