Search Unity

Help Wanted wavy grass not showing up in my viewport - but ok when previewing prefab

Discussion in 'Shader Graph' started by whidzee, Aug 9, 2019.

  1. whidzee

    whidzee

    Joined:
    Nov 20, 2012
    Posts:
    85
    I have a wavy grass shader (I originally wrote this in HDRP and converted it to be in an LWRP scene)
    When I view my grass prefab it looks fine. however when i place the grass in my scene it is completely invisible. I get no indication that i've placed it except for the XYZ manipulator gizmo showing me that it's there.

    Now the funny thing is that when i dissconnect my wind effect on the material to the PBR master node then the grass shows up.

    This is the wind movement part of my grass shader. Is there anything in there that you can see is going to be causing a problem?

    im especially baffled by the fact that i can see it fine when i preview the prefab but not when i view it in the editor (or when i play it)

    upload_2019-8-8_23-55-49.png
     
  2. alanmthomas

    alanmthomas

    Joined:
    Sep 7, 2015
    Posts:
    136
    My guess for this is something happening in the position is placing the object far offscreen. I'm not sure what that camera position node is doing, but I didn't have one in a graph of mine that is similar and it worked just fine for me. Try feeding that last Lerp directly into the transform node and see what happens.
     
  3. Flow-Fire-Games

    Flow-Fire-Games

    Joined:
    Jun 11, 2015
    Posts:
    190
    I did have the same issue, dont remember exactly but most likely is the strength way too high so it just displaces insane far

    I did remake your right side and works for me
     
    Last edited: Aug 13, 2019
  4. iSinner

    iSinner

    Joined:
    Dec 5, 2013
    Posts:
    127
    You don't need to subtract camera position, that operation is only needed for HDRP since world position there is relative to camera(for some reason) not relative to actual world (0,0,0).
     
  5. brownboot67

    brownboot67

    Joined:
    Jan 5, 2013
    Posts:
    365
    It's to stabilize rendering (no world position floating point issues).
     
    iSinner likes this.
  6. iSinner

    iSinner

    Joined:
    Dec 5, 2013
    Posts:
    127
    I see.

    They need to make the thing that is called world position, be world position, not camera position.
    The way it is set up now is confusing.