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 Shadergraph reflective cubemap with normal map

Discussion in 'Shaders' started by galamot-shaku, May 29, 2021.

  1. galamot-shaku

    galamot-shaku

    Joined:
    Apr 25, 2015
    Posts:
    3
    Hello, I was wondering how to achieve a material like the unity legacy reflective bump lit shader in shader graph. So far I made a basic urp lit shader with an albedo, normal and a cubemap reflection, however I want the normal map to distort the reflection of the cubemap as the previously mentioned legacy shader. This are the nodes I'm using. Any suggestions on how to achieve that effect?
    Thanks :)

    fds.PNG Cube.gif
     
  2. galamot-shaku

    galamot-shaku

    Joined:
    Apr 25, 2015
    Posts:
    3
    Edit: I figure out that I can blend the normal map with a blend normal node into the Sample reflected cubemap normal. And it seams to work fine. If anyone has another method let me know.
     
  3. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,374
    The normal map vector is in tangent space.

    The Sample Reflected Cubemap node is expecting a world space normal as an input.

    You want to use a Transform node using from Tangent to World to take the tangent space normal and transform it to world space.