Due procedural textures lacks of mipmaps, how to fix them in the material? Is to avoid in far view looks noisy.
All without use the TextureSample/Texture object trick.
Any idea? #UnrealEngine #UE5 #TechArt #Indiedev
@DavitMasia A simple approach is to fade out the pattern to average colour based on derivatives (DDX/DDY) of grid position - when the derivative approaches the size of your grid you reduce the amplitude of the pattern to 0.
For more complex solutions see:
https://bgolus.medium.com/the-best-darn-grid-shader-yet-727f9278b9d8
@dougbinks Wow, very extensive, thanks!
@dougbinks I tried the shader it provides, but no idea why i get differnt visual if i look in X or Y axis ¿?.
In one axis the lines goes more fat, but they are stable, in other axis they looks as it should in distance but TAA makes some jazzing. I tried different quality settings but always same thing.
@DavitMasia If you're able to use Renderdoc this might help you debug why there is a difference. See https://dev.epicgames.com/documentation/en-us/unreal-engine/using-renderdoc-with-unreal-engine for a guide.
@dougbinks Already found the issue, i had to use float2 , now all looks much better.
@DavitMasia
> procedural textures lacks of mipmaps
generate texture in buffer - generate mipmap for buffer - it is very cheap by performance and work every frame - this is best option
but it not always possible to make single texture from procedural - if it fractal-like stuff
for simple cases on your screenshot - https://iquilezles.org/articles/filterableprocedurals/
for complex (worst by performance) - for loop 10x10 times per pixel for SSAA -
https://www.shadertoy.com/view/MdjGR1
https://www.shadertoy.com/view/4lXfzn
UnrealEngine - no idea