Tiling
Texture Variation: https://iquilezles.org/articles/texturerepetition/
Blender: https://www.youtube.com/watch?v=-VgtSL5ZpYc
Visible repetition of texture is the common problem of a large scale mapping. To avoid the repetition, we can:
- add random offset and orientation to each tile.
- This has a boundary problem, because tiles won’t match anymore.
- Mipmapping will break because the discountinuity in the final texture fetch coordinates themselves.
- To solve the problems, we can sample multiple times with offset and orientation and blend them near the border of the tile.
- for example
- randomly offset, scale, and rotate the original texture and blend them on the weight factor of the distance to the center of each copy.
- use smooth voronoi pattern
Shader
tex2Dgrad(s, t, ddx, ddy)
https://www.gamedev.net/forums/topic/470659-anyone-tell-me-the-difference-of-tex2dgrad–and-tex2d/
Graphics hardware works with a 2x2 “quad” of pixels. The derivatives of screen space are the rate of value change in horizontal and vertical in this quad. This partial derivative show the texture coordinates change is helpful in choosing mip level of the texture. For example, mapping 1 texel to 1 pixel is the top mip level. If we scaled down the mesh by half, the derivative will be twice as large, so the graphic hardware will use the next mip level.
Tri-planar Projection
Ben Golus: [https://bgolus.medium.com/normal-mapping-for-a-triplanar-shader-10bf39dca05a](