Search Unity

shader graph, flip normals for VR sphere

Discussion in 'AR/VR (XR) Discussion' started by ivan_unity180, Feb 13, 2019.

  1. ivan_unity180

    ivan_unity180

    Joined:
    Nov 13, 2018
    Posts:
    2
    Have any of You guys can help with the creation of a shader, using shader graph(is this possible?) that let me flip the normals of a sphere, sorry I have no experience coding shaders :(, I am trying to make a video player (which I am done with all the things that has to do with the player but the shader using shader graph its a pain in the @55



    by the way I am using, the oculus go platform and it goes awesome
     
  2. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,983
    If there is an inverse node, try that? Sorry dont use shadergraph enough to be more help

    EDIT: shouldnt this be as simply as multiplying the normal values by -1?

    Just try using a multiply node with -1 as the value and use that on the normal output
     
  3. dmennenoh

    dmennenoh

    Joined:
    Jul 1, 2015
    Posts:
    379
  4. ivan_unity180

    ivan_unity180

    Joined:
    Nov 13, 2018
    Posts:
    2

    that is what I thought at the begining but nope, did not work at all, Ill show you tomorrow, when I am back at the office :D, and show you some experiments about this topic :D
     
    MadeFromPolygons likes this.
  5. alexanderameye

    alexanderameye

    Joined:
    Nov 27, 2013
    Posts:
    1,383
    Any updates?
     
  6. magnussen81

    magnussen81

    Joined:
    Mar 8, 2019
    Posts:
    7
    So my solution to this is setting the master node to either transparent or opaque alpha cutout, two sided rendering and using the "Is Front Face" node (bool) in a predicate branch and plug it into alpha.

    https://github.com/Unity-Technologi...y.shadergraph/Documentation~/Is-Front-Face.md

    Effectively "hiding" the front face and only showing the back.
    Hope it helps (I think a lot of other people would need this too).
     
  7. DavidJMacias

    DavidJMacias

    Joined:
    Mar 23, 2014
    Posts:
    4
    I actually got this working by creating a vector normal node, multiplying it by .5 (1 made it 2 times as big for some reason) and then it was good to go. Opaque, one-sided, no alpha clipping. I plugged it into vertex position.
     
    Last edited: Oct 8, 2021
    hard_hand likes this.
  8. colinleet

    colinleet

    Joined:
    Nov 20, 2019
    Posts:
    189
    Just set the shader graph to draw back faces only.
     
    Last edited: Aug 30, 2023
  9. Alissrip

    Alissrip

    Joined:
    Dec 26, 2021
    Posts:
    3
    THX U SO MUCH!!!!!
    I was overthinking it too much and it was much simpler than I thought!