Replacement Shader equivalent?

Hello!

I want to implement simple order indiependent transparancy for an existing URP project. For this I need to draw all materials with a special shader pass again. However using a override Material would not allow me to accsess the data of the original materials.

Any ideas?

It seems the shader replacement system from the built in rendering was removed in URP. So, if an override material per layer isn’t fine grained enough, I think we have to write our own script to access all the materials of all the renderers in question.

That sounds like A LOT of unneccesarry overhead. :confused:

It’s actually possible to recreate replacement shader behavior with abusing ShaderLOD system. Even without modifying any URP sources.

2 Likes

@BattleAngelAlita Interesting, I need to look into that. Thanks for the tip. I find it weird that such necessary thing aren’t working straight out of the box…

Hi, can i ask you how did you use LOD to replace shaders ? Is it possible if using Shader Graph in URP ?
I’ve done some work for the graphics of my project, using URP and Shader Graph.
But now that i see there’s no replacement shader, i’m forced to redo everything unless i find a workaround.
Thanks for any response !

Tepei
If you can setup custom fallback shader from SG then yeah.
Then just change Shader.globalMaximumLOD from a script.

Very thanks,
I could make it work, editing the generated shader located in a temp folder.
But then the shader could not be open again in shader graph.
Also now i struggle to find an equivalent to OnPreRender() in URP to make each camera a different LOD.
Thanks !

The “Render Objects” render feature isn’t exactly a replacement, but worth trying out if you haven’t already URP Renderer Feature | Universal RP | 10.1.0

Thanks but the Render Object could not do what i need.
Rendering object and some part of their textures/propriety with a different shader.
Finally i got it. The scriptable renderer was incomprehensible for me. :sweat_smile:
But with this page i found what i need :
https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@7.4/manual/using-begincamerarendering.html

It works ! Very thanks !
But i’m now hesitant to stay on the urp…