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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Issue with Standard Shader's Detail Albedo mask

Discussion in 'General Graphics' started by unity_RM3BzyERhvkW2w, Apr 8, 2019.

  1. unity_RM3BzyERhvkW2w

    unity_RM3BzyERhvkW2w

    Joined:
    Apr 8, 2019
    Posts:
    2
    Hello all,

    Picture down below to demonstrate what I'm having issues with.

    I am trying to place a texture and move it within a material. Now I've gotten my 2D image, in which none of the pixels touch the border of the image, and I've set it to 'Clamp' in its settings.
    I've placed it in the Detail Albedo field of the Standard Shader and by setting the Tiling to 2x2 it's now 1/4th the size of the full texture. This all is intended behaviour.

    However, as you can see, the pixels at the edge of the Detail Albedo field stretch all the way to the edges of anything I apply this material to.

    Any advice?

    Thanks in advance!

    - Ramses

    upload_2019-4-8_17-22-45.png
     
  2. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,360
  3. unity_RM3BzyERhvkW2w

    unity_RM3BzyERhvkW2w

    Joined:
    Apr 8, 2019
    Posts:
    2
    Unfortunately that's the opposite of what I want to accomplish. I simply want to place this texture within the material somewhere using the Offset.
     
  4. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,360
    In that case, I think you need to provide a "detail mask" texture to mask out what part of the main texture that the detail texture should cover.
    https://docs.unity3d.com/Manual/StandardShaderMaterialParameterDetail.html
    I couldn't see in the documentation about what format that texture needs to be in, so I don't know if it needs to be grey-scale or alpha.

    It looks like what you are trying to do is not really what a detail map was intended for, so it may not be the best solution.
     
  5. dchakrabarty

    dchakrabarty

    Joined:
    Mar 1, 2019
    Posts:
    4
    You do not need to store the mask in alpha channel of the Image. Just choose "From Grayscale" as Alpha Source in your detail mask texture. I keep all my maps in TIFF and just enable this option for the detail mask and it works.