Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

HDRP MaskMap Channels and Decals question

Discussion in 'Graphics Experimental Previews' started by Ziboo, Jul 12, 2018.

  1. Ziboo

    Ziboo

    Joined:
    Aug 30, 2011
    Posts:
    356
    Hi,

    I have two simple questions for you devs ;)

    1. Why did you use the alpha channel to store the Smoothness instead of blue channel ? I'm pretty sure that smoothness will always be used compare to Detail (B).
      We have to use DXT5 over DXT1...
      Am I missing something ?
    2. Will you have the options to set Layers for decals ? I saw that materials have option "Enable Decal", but that is not enough. (ex: decal that affect only Characters and not Environment)
    Thanks
     
  2. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    Because the alpha channel is compressed at a higher quality than the blue channel, which can make a large difference for smoothness maps.
     
  3. Ziboo

    Ziboo

    Joined:
    Aug 30, 2011
    Posts:
    356
    bump

    Any news on supports for layers on decals ?
     
  4. Remy_Unity

    Remy_Unity

    Unity Technologies

    Joined:
    Oct 3, 2017
    Posts:
    704
    We should support decal gameobject beeing culled depending on the current camera layer mask (was missing, I filed a bug for it), but it's not possible to have a layer mask per decal projectors.
     
    BATTLEKOT likes this.
  5. Ziboo

    Ziboo

    Joined:
    Aug 30, 2011
    Posts:
    356
    Yep I wasn't talking about culling.
    You know that without a layer system it's kind of useless.

    If I put decals for the environment, I don't really want them to project on characters.

    Is that on the roadmap though ?
     
  6. Remy_Unity

    Remy_Unity

    Unity Technologies

    Joined:
    Oct 3, 2017
    Posts:
    704
    @Ziboo: You can disable "support decals" on your character's material. To further more avoid bad projection of decals, you can use mesh decals (simply assign a decal material to a mesh).
    But a layer mask per decal project would raise the cost of the rendering, and is not on our roadmap for the moment.
     
  7. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Use the tickbox on HDRP materials to prevent decals drawing on characters.

    For character "decals" we will probably go with some kind of shader graph to blend an effect at a location of some sort (undecided but that's what's needed for perf).
     
  8. hertz-rat

    hertz-rat

    Joined:
    Nov 3, 2019
    Posts:
    71
    Is this still the case in 2020? Its a bit of a large, error-prone task to go through every single material in the project and remember to tick that checkbox.

    Also, it would be nice to have a bullet hole decal we could place on a unit without needing to have that unit's selection indicator draw on it as well.

    Does anybody know of a good workaround for this? What about hot swapping out a unit's materials with ones pre-configured to have the effects showing? Eg, have 40 materials per unit, each with a different combination of damage patterns?
     
    Gooren likes this.
  9. Gooren

    Gooren

    Joined:
    Nov 20, 2015
    Posts:
    332
    I second that question.
     
  10. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    789
  11. hertz-rat

    hertz-rat

    Joined:
    Nov 3, 2019
    Posts:
    71
  12. CGEyeGuy

    CGEyeGuy

    Joined:
    Aug 19, 2017
    Posts:
    1
  13. KYL3R

    KYL3R

    Joined:
    Nov 16, 2012
    Posts:
    135
    That github link is now 404. What is the current state? Does it work with layers? I have 2019.4 LTS installed and the default HDRP/Decal Shader does now allow me to define a LayerMask :/
    upload_2020-7-5_11-22-54.png
     
  14. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    789

    It's not implemented yet and when it does it won't be for 2019.4. It will probably be for 2020.1 as the earliest and most likely 2020.2 the latest.

    Two latest Updates on it.

    Changelog
    - Added decal layer system similar to light layer. Mesh will receive a decal when both decal layer mask matches.

    https://github.com/Unity-Technologies/Graphics/commits/HDRP/decal-layer-mask-mesh
    https://github.com/Unity-Technologies/Graphics/commits/HDRP/decal-layer-mask-material
     
  15. KYL3R

    KYL3R

    Joined:
    Nov 16, 2012
    Posts:
    135
    @Grimreaper358 Thanks a lot for the info, that's the first reason for 2020.1 to me :)

    But all the 3 links you provided end in 404 on my side...


    I found this:

    "From Unity 2020.2, you can use the Decal Layers system which makes use of the Rendering Layer Mask property from a Mesh Renderer and Terrain. The default value of this property prior to 2020.2 does not include any Decal Layer flags. This means that when you enable this feature, no Meshes receive decals until you configure them correctly. A script Edit > Render Pipeline/HD Render Pipeline > Upgrade from Previous Version > Enable Decal Layer Default on all loaded Mesh Renderer and Terrain is provided to convert the already created Meshes, as well a version to apply only on a selection. Newly created Mesh Renderer or Terrain have the have Decal Layer Default enable by default."

    https://github.com/Unity-Technologies/Graphics/pull/1136#pullrequestreview-443264651
     
    Last edited: Jul 21, 2020
  16. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    789

    They switched the repository so all the links from the old one will be broken. Currently, Decal Layer is already implemented into HDRP 10.x.x for 2020.2 alpha and forward. It's probably also in 9.x.x for 2020.1 but I'm not sure as I haven't used that version in a long time. I think it might be there, at least for the final release of 2020.1.
     
  17. Gooren

    Gooren

    Joined:
    Nov 20, 2015
    Posts:
    332
    Well... that's unfortunate. The entire 2020 branch is unusable for us since it has no realtime GI solution available.
    Flipping amazing...