HDRP MaskMap Channels and Decals question

Hi,

I have two simple questions for you devs :wink:

  • 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 ?
  • 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

Because the alpha channel is compressed at a higher quality than the blue channel, which can make a large difference for smoothness maps.

bump

Any news on supports for layers on decals ?

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.

1 Like

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 ?

@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.

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).

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?

1 Like

I second that question.

Decal Layers is being worked on. https://github.com/Unity-Technologies/ScriptableRenderPipeline/commits/HDRP/decal_layers

1 Like

Thanks! (and thanks to whomever is working on it!)

could really use hdrp decal layers because unchecking receive decals only applies to the base color and not the emission

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 :confused:
6056537--655526--upload_2020-7-5_11-22-54.png

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.

@Grimreaper358 Thanks a lot for the info, that’s the first reason for 2020.1 to me :slight_smile:

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

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.

Well… that’s unfortunate. The entire 2020 branch is unusable for us since it has no realtime GI solution available.
Flipping amazing…