Search Unity

Question How can I create this kind of effect?

Discussion in 'Shader Graph' started by Passeridae, Feb 7, 2021.

  1. Passeridae

    Passeridae

    Joined:
    Jun 16, 2019
    Posts:
    395
    Hi!
    I'm trying to create this gradient:

    Where:
    1) The pink dot is the gradient center in absolute world coordinates
    2) The orange circle arrow is the rotation degree
    3) The green arrow is the blur strength and direction

    That's what I need it for:



    1) The center is the would-be door hinges
    2) the rotation should go along the door panel
    3) the blur is supposed to start from the door opening and grow along the shadow away from it.

    All in all, it's a separator between two sets of lightmaps, so it should act like a shadow from the door.
    I'm not trying to replace regular shadows and etc, just have some specific setup where I need this kind of thing.

    My current setup is this:



    I've tried to use the smooth step for the blur gradient that is driven by a world axe perpendicular to the door wall, but it distorts the "shadow" too much.

    I also can't use the rotation in a convenient manner, because it doesn't cover the 180 angle completely.

    So, if anyone know how to correct this method to achieve a gradient I need, I would be really grateful!

    Thanks!