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 Trying to use a texture for a vertex offset map.

Discussion in 'Shader Graph' started by KnoblePersona, Dec 26, 2020.

  1. KnoblePersona

    KnoblePersona

    Joined:
    Oct 13, 2020
    Posts:
    15
    I need help. I can't seem to get this to work. All I need to do is connect an image here to the vertex position in my PBR Master node, but anything related to an image doesn't seem to work. Is there any way I can convert this texture into an acceptable format that the Vertex Position will accept?

    Edit: I know Sample Texture 2D needs to be expanded. I forgot to expand for the screenshot.

    ShaderGraph.png
     
  2. LandonTownsend

    LandonTownsend

    Unity Technologies

    Joined:
    Aug 21, 2019
    Posts:
    35
    Hi,
    Sample Texture 2D internally uses ddx/ddy to determine LOD levels. Since those are not allowed in the vertex shader, it can not be plugged into anything leading into Vertex Position.
    Use Sample Texture 2D LOD instead for the vertex phase.
     
  3. KnoblePersona

    KnoblePersona

    Joined:
    Oct 13, 2020
    Posts:
    15
    Okay, thank you so much for the help.
    Okay. Thank you so much for the help!