Search Unity

Question Use RenderObjects feature to render objects differently according to a shader property

Discussion in 'Universal Render Pipeline' started by Noxalus, Apr 2, 2021.

  1. Noxalus

    Noxalus

    Joined:
    Jan 9, 2018
    Posts:
    80
    Hello everyone,

    I'm using URP with Unity 2020.2.0f1 (v10.2.2) and I would like to have a specific vision mode I can enable/disable to render all objects of the scene as black and white except some of them that have a specific property with a float value that will show them with a color taken from a gradient using this property.

    I've already did some researches, and I know I can use a new Forward Renderer Data with a RenderObjects feature that allows me to use a specified Material to render all the scene so I created a new shader with the float property and created a Material from it to use it for the RenderObjects, but in fact, the actual Material on each object remain the same, so I can't really change this property value.

    Do you know how I can render object differently using per object property with a RenderObjects feature ?