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. Join us on March 30, 2023, between 5 am & 1 pm EST, in the Performance Profiling Dev Blitz Day 2023 - Q&A forum and Discord where you can connect with our teams behind the Memory and CPU Profilers.
    Dismiss Notice

Feature Request Mostly render pass annoyances and extra stuff in URP

Discussion in 'Universal Render Pipeline' started by Arrovs, Jun 19, 2020.

  1. Arrovs


    Sep 23, 2014
    Hello community and developers.

    Im moving my project from old renderer to URP.
    At start everything felt well thought out and transition went fast, but now im fighting with some annoying things and want to share them.

    - First and least annoying thing was custom postprocessing. And it was easely fixed by simple custom renderfeature. Dont know what developers are engineering behind curtains that could be so much better.
    And it turned out to be better solution than in old renderer with extra control URP provides.
    * Second is shader passes. There arent per renderer passes. Thought, ou well here is renderfeatures again for custom passes, but those work per layer, per whole layer. It is too broad, i need more granular control over renderers.
    * That leads to third annoyance which has come to be biggest and worst and can be easely fixed from developers. Physics and graphics use same layers. I have broad layers called collision, nocollision and trigger as also more finetuned. Now there comes graphical layers. I want few of them to be colorable with extra pass and some not. So it means now i need to doable layer name count by adding colorable and notcolorable to them. Layer count is already very limited. Afterwards this also brings complexity to code. When i want to turn off collisions now i need to also check for its color status which it shouldnt know at all. In other words this can be easely fixed by splitting those both apart making physics layers and graphics layers.
    * Fourth, it brings me back to renderfeatures/passes. Even with additional graphics layers it is still too broad. I can have need to make 4 different outlines for enemy power levels and same for items and then other useful gadgets and by itself per camera rendering layers like ui, transparent and opaque. And this brings long list also to renderer passes in place of single outline pass with per renderer customization.
    * Fifth thing. Moving passes away from shaders actually sounded neat in as that allows good modularity and i can now stitch passes on whole kind of materials without making specific shader versions for them, but implementation just isnt there. Than it is better to add extra material to renderer and swallow down that warning message with performance loss. Actually, i even dont know how this can be worse to performance than extra pass in renderfeatures. In both cases mesh needs to be drawn twice, so it should be same work and time(with small imrpovements in more optimized side).
    * Sixt thing. It have plusses and minuses, so it is just minor nuisance. Camera stacking. I have gradient skybox wich i also use as fog over opaques. I have quality settings where low end devices can turn this off. In old system this camera was under my current base camera and in one case it colored background and in second in render texture to be applied on scene later. Beautiful. Now with specific base camera i cant do this. This means that i need to draw skybox twice once for base camera background and second time for fog. Afterwards i need to apply ui camera on top from additional persistent ui scene. It was also really simple by adding highest priority on that camera now i need extra script for uicamera(which i had anyway) and also script for base camera that adds ui camera to base camera. Somehow i feel that stacking is implemented like it is just to remove features from editor window in overlay cameras.

    This list is long enough so i should end.
    If other developers have similar annoyances and have found solutions, please let me know. As also, if you are one of developers take notes and try to improve system for all of us.
    Most of this surely is also applied on SRP all together.
    Sokobicie likes this.
  2. Arrovs


    Sep 23, 2014
    I have some good news.

    I thought that MaterialPropertyBlock is bound to material through renderer, but seems that was Mandela effect. Need to play with overrider materials (which come from render features) and those blocks. Possibly this will give so much needed control. I know that this does not work with srp batcher, but there is also gpu batching. Hopefully this will work.

    Some good person in Unity added RenderingLayerMask to renderer. I have now beautiful way to customize which renderers will receive features. Bad part is that they forgot to make universal LayerMask struct/class which could be bind to different kinds of layer name tables and also for easy code and editor use. Hopefully this will come. Till then im fine to use int numbers and flag enums additionally to default numbered layer list. This should also be added to included RenderObjects feature otherwise i needed to make my own version.
    romanpapush likes this.