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. Dismiss Notice

Resolved How to make a camera render only decals

Discussion in 'Universal Render Pipeline' started by StrangeWays777, Jul 6, 2023.

  1. StrangeWays777

    StrangeWays777

    Joined:
    Jul 21, 2018
    Posts:
    29
    I've set the GameObject the Decal Projector is on to a layer called 'FOV' and I've created a camera that only renders that layer but for some reason the Decal doesn't show in the camera and it renders nothing.
    Is there a way to do this?
     
    Last edited: Jul 8, 2023
  2. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    1,834
    What effect are you actually trying to achieve?
     
  3. StrangeWays777

    StrangeWays777

    Joined:
    Jul 21, 2018
    Posts:
    29
    Basically I want to only render the decals and nothing else so that I can output the render in to a texture and then I can use that texture as a mask in another shader.
     
    Last edited: Jul 8, 2023
  4. StrangeWays777

    StrangeWays777

    Joined:
    Jul 21, 2018
    Posts:
    29
    Bump.

    EDIT: I found a way to achieve what I wanted by rendering the camera with the decals enabled and then rendering it again with the decals disabled then passing the two render textures in to a shader to compare the differences to make a mask which I then used for the cutout. It was awkward but the end result is perfect!
     
    Last edited: Jul 8, 2023