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’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

Question Blob shadow projector in HDRP

Discussion in 'High Definition Render Pipeline' started by themeshpotato, Jan 7, 2020.

  1. themeshpotato

    themeshpotato

    Joined:
    Apr 11, 2018
    Posts:
    55
    Is it true that there are no alternatives for blob shadow projectors in HDRP?
    It doesn't seem like that the decal projector can limit the decal depending on angles, which makes it fade out in a weird way.

    upload_2020-1-7_10-24-58.png

    Is there a way to fade it out depending on the distance from the center in world space instead?
    Right now I'm just using a gradient calculated from the UV, which probably is a bad idea.

    Thanks in advance!
     
  2. themeshpotato

    themeshpotato

    Joined:
    Apr 11, 2018
    Posts:
    55
    Bumping this to see if anyone can help.
    I tried fading out the effect depending on the distance from the center of the character, but that didn't work for some reason.
    Am I wrong in assuming that the world position I get from the Position-node in a decal graph gives me the correct world position that I can then use to calculate the distance to the character center?

    It seems so simple, but I can't get anything to show up.
     
  3. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    The issue with the bleeding is that you'd need scene normals to be able to omit the decals getting projected at extreme angles. On HDRP decals are processed quite early in the framegraph, prior to that data being present yet, see the order here: https://docs.unity3d.com/Packages/c....1/manual/Images/HDRP-frame-graph-diagram.png
    On deferred HDRP, you can enable Depth prepass and technically you could calculate scene normals from it but it's bit expensive and inaccurate (but might be enough for this purpose).

    That being said, you can just toggle "Receive Decals" off from HDRP materials that you don't want decals to get projected for. This could be a solution if you don't need decals for walls etc otherwise.
     
    themeshpotato likes this.
  4. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
  5. themeshpotato

    themeshpotato

    Joined:
    Apr 11, 2018
    Posts:
    55
    Thanks for the suggestions and the links! The problem with using different materials that have decals enabled/disabled is that we often have objects that act as both ground and walls.

    And yeah, enabling the depth-prepass to be able to calculate the normals sounds too expensive, like you said.

    I guess I was hoping to be able to fade it out just based on the distance from the center point, but the position-node doesn't seem to give me the position I expected.