Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question [Solved] mipmaps + SAMPLE_TEXTURE2D_ARRAY_GRAD ?

Discussion in 'Shaders' started by nukadelic, Sep 6, 2023.

  1. nukadelic

    nukadelic

    Joined:
    Aug 5, 2017
    Posts:
    65
    Is there a way to sample a texture 2d array grad with mipmaps ? Making a custom terrain shader and i need to use the grad with ddx and ddy to fix texture seams but it looks like it no longer samples mipmaps ? is there a way to manually do that or is there a alternative method for this ?
     
  2. nukadelic

    nukadelic

    Joined:
    Aug 5, 2017
    Posts:
    65
    solved : same method - the ddx/ddy needs to sample the default UV0 and it has to be a tilling value relative to the mesh size , so the default value of tilling 1 will not be enough for a large mesh , but something like a value of 5 works fine for a 250x250 mesh size in unity units.