Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Why I can't add Sample Texture 2D multiple to position

Discussion in 'Shader Graph' started by Rachan, Aug 22, 2023.

  1. Rachan

    Rachan

    Joined:
    Dec 3, 2012
    Posts:
    792


    as the name of topic, Why I can't add a Sample Texture2D multiply with position?

    I working on create shader for grass or tree, that can only sway at top of the sprite
    so I would multiply it with some gradient texture like this, But I can't add it to any node

    any suggestion?

    Thanks!!!
     
  2. wwWwwwW1

    wwWwwwW1

    Joined:
    Oct 31, 2021
    Posts:
    782
    Hi, the vertex stage doesn't support Sample Texture 2D node, which automatically choose a suitable mipmap level for the texture. You should use Sample Texture 2D LOD node and provide a mipmap level (usually 0) instead.

    Detailed explanation from another post:
     
    Rachan likes this.
  3. Rachan

    Rachan

    Joined:
    Dec 3, 2012
    Posts:
    792
    Whow Thank you very much! I changed to use Preview+Power node instead, I don't know which one is heavier?
    between small gradient Texture and Gradient Logic by Preview.
     
    wwWwwwW1 likes this.
  4. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    1,337
    Two days ago someone answered you that preview node is complied away and you got several other advices about shader performence, and I think you are still asking the same thing. Furthermore I am pretty sure this is not the first time it's the case. I don't know what is the reason, if you just don't read what people write, or you don't understand what they said, or you picked wrong words to describe the problem, but you should stop doing this.