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
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Decal shader problems

Discussion in 'Graphics Experimental Previews' started by pointcache, Sep 7, 2018.

  1. pointcache

    pointcache

    Joined:
    Sep 22, 2012
    Posts:
    577
    Hi, im working with decals and noticed several design issues with the provided shader.

    Lets take a look at this simple example
    upload_2018-9-7_8-57-45.png
    upload_2018-9-7_8-57-58.png
    As you can see the circle around the screw is the problem.
    It happens due to the following:

    This is the albedo:
    upload_2018-9-7_8-59-6.png
    and the alpha, which is used as a decal mask
    upload_2018-9-7_8-59-20.png
    normals
    upload_2018-9-7_8-59-48.png
    metallic

    and the overall mask map


    here is the alpha (blending mask) overlayed on top of other channels


    So the problem is as follows.
    To properly cut out the decal from the atlas, you need a mask.
    That mask will guide all the channels at once.
    Meanwhile some channels, like roughness, or metallic, or albedo, would need more refined masks,
    otherwise they will overwrite gbuffers in places you dont need it to.

    All in all i would like to have a shader that allows masking per channel.
    Also emission on decals would be very nice.