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

parallax occlusion mapping

Discussion in 'Shaders' started by zumwolt, Nov 12, 2019.

  1. zumwolt

    zumwolt

    Joined:
    Jan 15, 2017
    Posts:
    6
    Hi people!
    Do we have a any node for parallax occlusion mapping, or any bump mapping, to create it in the Shader graph, and use with lightweight render pipeline?

    Here is node https://github.com/anaseinea/Parallax-Mapping-Node-Unity
    But it doesn't working with Unity 2019.2.9.f1

    I think it is very important for today, and it should be as a default node in shader graph, but anyway, if you know any solution for this issue, please let us know
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,256
    Unity's early releases of Shader Graph included a Custom Node API for writing our own custom nodes in c#. They wrote a bunch of blogs about it and gave it its own entry in the official Shader Graph documentation!
    https://docs.unity3d.com/Packages/c...anual/Custom-Nodes-With-CodeFunctionNode.html

    A few months ago they deleted all of that and replaced it with the a Custom Function Node, which is just a node you can add hlsl code to directly, but without all of the benefits their existing node API has, like custom UI, drop downs, or more complex and dynamic inputs / outputs.
    https://docs.unity3d.com/Packages/com.unity.shadergraph@7.1/manual/Custom-Function-Node.html

    They also locked down the node API so you can't write real custom nodes anymore. Ironically the official documentation for some versions of Shader Graph still have a page link to the Custom Node API, but it takes you to a 404, but not the Custom Function Node that's been there since Shader Graph 6.0 or so. So yeah, that github project is effectively dead and will never work with Unity ever again.

    On the other hand you can copy and paste the hlsl code from that node into a Custom Function Node and it'll kind of "just work".
     
  3. zumwolt

    zumwolt

    Joined:
    Jan 15, 2017
    Posts:
    6
    Thank you, but it doesn't working, when i create a hlsl file and copy into this c# script, result was syntax error, and nothing was working.
     
  4. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,256
    hlsl isn't c#, you need to copy the hlsl code embedded in the c# into a function inside an hlsl file, or directly into the text field of the Custom node.