Search Unity

HDRP Decal Projector missing Affect Transparency checkbox for Decal Graph shader

Discussion in 'High Definition Render Pipeline' started by grejtoth, Apr 7, 2020.

  1. grejtoth

    grejtoth

    Joined:
    Aug 7, 2015
    Posts:
    14
    Hi!

    I'm currently using Unity 2019.3.0f6 with HDRP 7.2.1.

    My problem is, if I create a shader using "Create/Shader/HDRP/Decal Graph" I don't have the option to make it affect transparent objects. If I use the shader "HDRP/Decal" the checkbox is there. Am I missing any step?

    Custom Decal Shader
    upload_2020-4-7_16-18-10.png

    Using HDRP/Decal shader
    upload_2020-4-7_16-19-39.png

    upload_2020-4-7_16-20-11.png


    Thanks!
     
    Spoonfishlee likes this.
  2. grejtoth

    grejtoth

    Joined:
    Aug 7, 2015
    Posts:
    14
    Update: Found this in the source code for the DecalProjector and DecalSystem.

    This is found on the DecalProjecotrEditor.cs
    Code (CSharp):
    1.  bool showAffectTransparency => ((target as DecalProjector).material != null) && DecalSystem.IsHDRenderPipelineDecal((target as DecalProjector).material.shader);
    And this on DecalSystem:
    Code (CSharp):
    1.  static public bool IsHDRenderPipelineDecal(Shader shader)
    2.         {
    3.             // Warning: accessing Shader.name generate 48B of garbage at each frame, we want to avoid that in the future
    4.             return shader.name == "HDRP/Decal";
    5.         }
    Help?
     
  3. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Hi shader graph don't support the "Affect transparency" option. This is because those decal affecting transparency require an atlas, so we will require to rasterize the shader graph result into the altas. Something we haven't done. I will be sure the documentation is up to date if not.
     
  4. grejtoth

    grejtoth

    Joined:
    Aug 7, 2015
    Posts:
    14
    Hi, Thanks for the information!

    So, for now, is there a way to make a custom projector that affets transparent objects?
     
  5. nehvaleem

    nehvaleem

    Joined:
    Dec 13, 2012
    Posts:
    438
  6. NathanSr

    NathanSr

    Joined:
    Nov 10, 2019
    Posts:
    1
    Hi @SebLagarde,
    Trying to do some custom decal shader graph shaders that apply to transparent surfaces but ran into this issue.

    Have noticed that switching material to HDRP/Decal enabling "Affect Transprent", then switching back to custom shader works for a bit, but after reloading Unity it seems to default off again.

    Is there something under the hood now that allows for this but it simply forced off by Unity code?
    Is it possible custom shader graph shaders will have access to "Affects Transparent" in future versions?

    Thanks :)
     
  7. rempelj

    rempelj

    Joined:
    Aug 3, 2013
    Posts:
    54
  8. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Hi,

    Decal Shader graph with Affect Transparent is still not supported and we have currently not plan for it.

    To do it, it required to render the result of the shader graph inside a Decal Texture Atlas. If the shader graph is animated it is required to do it everyframe. We haven't done this work currently due to other prioties.
     
  9. alti

    alti

    Joined:
    Jan 8, 2014
    Posts:
    94
    shucks.
     
  10. Geuks

    Geuks

    Joined:
    Jan 31, 2017
    Posts:
    2
    update ?
     
    domos2345 likes this.
  11. domos2345

    domos2345

    Joined:
    Nov 14, 2021
    Posts:
    1