Search Unity

Render pass between base color and light process ?

Discussion in 'General Graphics' started by LucasForcinaSD, Nov 29, 2021.

  1. LucasForcinaSD

    LucasForcinaSD

    Joined:
    Sep 13, 2021
    Posts:
    18
    Hey guys,
    I feel like I'm trying to achieve black rendering magic but here is my problem:

    First of all I'm using Unity 2021.2.2 and the latest version of the URP

    I want to apply a gradient on my objects that will multiply the BaseMap of my material (based on viewport), but without having to do this is the shader of each object.

    Right now I have a subgraph that will do the same as the lit graph, and I take the output BaseMap and apply my effect on it, then replug everything in the output of the main graph :

    upload_2021-11-29_16-31-24.png

    and the result gives this (which is what I want, in fact), cute right ?



    (original for comparison):


    But to achieve this, I'm forced to apply the effect inside the objects graph; If I want to add new shaders, I'll have to add it in every shader.

    So I thought about using a blit render feature, so it applies to the whole screen, but since it is a pass that happens after the rendering (so it even multiplies shadows), it just looks like a photoshop layer and is not what I want :



    My question is:
    Is there a way to apply my effect to ONLY the object's base maps, without having to manually add the effect into the object's specific shaders ?

    TL;DR I want to:
    1) Render base Map
    2) Multiply base map by gradient (for everything, maybe filtered by layer)
    3) Finish computing light

    Thanks for your help!