RenderObjects Rendere Feature is missing support for Rendering Layer Mask

Hi there, I was wondering if there was an ETA for this or if this was even on the horizon?

RenderObjects is very convenient! And Rendering Layer’s seems just as powerful. A renderer can be a part of multiple different layers. This means we can have different special effects (Like the mage Occlusion example) use a specific Rendering Layer to ‘select’ renderers to apply the effect to. This way we can have multiple effects similar to the Occlusion example (multiple RenderObjects renderer features) all doing different effects, and renderers will have the ability to ‘opt in’ to the effect by being ticking on that Rendering Layer…

I’d also really like to hear Unity’s perspective on this. From whatever angle I look at it, it strikes me as though the Rendering Layer Mask was designed for this exact purpose, so it’s somewhat bewildering that the default RenderObjects renderer feature does not make use of it.

Apart from the obvious advantages described in the post above, it would also decouple the URP from the default layer system that comes with a whole host of architectural headaches.

Granted, the modular nature of the SRP system allows developers to create their own Renderer Feature if needed, but if there’s one thing that screams “default feature” to me, it would seem this one. Especially since it comes down to something so trivial (?) as switching one bitmask for another. Need be, RenderObjects could allow a choice between the two systems or a separate renderer feature could be added that only differs in the layer mask?

1 Like

I’ve poked the team. Should be easy enough to expose but i’ll let them answer :slight_smile:

1 Like

Hi, @Tim-C I’m wondering if you were able to poke the team and if they got you an answer? :slight_smile:

Hey there, I was just wondering if there was any movement on this?

Sorry to sound like a broken record but is there an update on this? I’ve just been asking since last year where I bumped my thread 3 times over 3 months with no response. Getting a response and then seeing you potentially forget about this thread feels a bit like a cruel joke. :frowning:

Hey @Prodigga ,
It was on my todo list this week to reply to you and take a look at this but there were some high priority issues and tasks that prevented me from doing that.

I’m going to try to take some time next week to look at this, see how much work it requires, etc.
Will get back to you.

Thanks so much for the reply and explanation! Take your time my dude.

I gave it a quick go myself, where I duplicated all of the classes involved in making RenderObjects work and just added a serialised Rendering Layer field. I tried to copy what you guys had done in the Renderer Editor to render/display a Rendering Layer mask since there doesn’t appear to be any built in support for it. I got everything hooked up. The rendered output did change in response to me altering the Rendering Layer on the renderer and/or altering the Rendering Layer mask on my RenderObjectsCopy object, but it didn’t look as expected. The wrong renderers were getting filtered out, and I couldn’t quite understand what was wrong so I just put it down and moved on.

2 Likes

Hey @Prodigga sorry for the delay on this. We added this feature request to our backlog. We are currently focused on the next 7.4.0 package release and many high priority items. Realistically we will only be able to look at this after the package is release.

Development wise it should be quick to do, however in URP we have taken the approach to only introduce features together with test coverage, example, docs and release QA. This naturally takes more take but guarantees we introduce features in a good quality state.

You can paste you custom RenderObject script here and we can help. Afaik, all that you need to do if you want to support tthis in your RenderObjectCopy is to add the serialized value and add set the rendering mask in FilteringSettings that is used for context.DrawRenderer : Unity - Scripting API: FilteringSettings

1 Like

Stoked to hear this. I understand it will take some time, no problem. I think the RenderObject feature will actually gain quite a lot of flexibility for this. Just very glad to hear it’s one component of Unity that’s being decoupled from the tyranny of the layer system.

Renderers should also expose and use this. I’ve currently copied urp locally so I can make these modifications. It’s very powerful. E.g:

I can specify on my renderer2d to not render layer2. Objects on layer2 are used for a screen distortion water effect, so they shouldn’t be rendered by default. Then I can create a render objects feature that copies screen color to texture and selectively render those layer2 water objects.

Works great. But of course I had to modify the renderer. Would love this kind of feature added by default

4 Likes

Hello, hate to necro this thread again, but any progress here? I checked a recent 7.4 release, but as predicted, it’s not included yet. I would be nice to hear an update, especially since I’ve seen the same problem come up spontaneously elsewhere .

1 Like

Yes it is a shame to have to edit the pipeline package directly or have to copy/paste/manually maintain our own version of this render feature just to expose a single value. I suspect this just keeps being put on the back burner or is lost/forgotten about. Its such a small change but would make the render objects features so much more useful. I have created a suggestion on the Unity Graphics portal. Here’s hoping.

I’m sure you are swamped with work, but were you ever able to investigate this @Elvar_Orn ? Sorry to ping you directly.

Unfortunately no, as you say I’ve been pretty swamped with other priorities recently. But to get things moving I decided to create a PR for this last night. It still needs some work and I can’t promise when it will land, but at least this is now in motion.

https://github.com/Unity-Technologies/Graphics/pull/1891

6 Likes

I’m also looking for this feature.

I want to create a dynamic “portrait-scene” that will be used to render animated tv-like portraits without having it affect anything in the main scene. I planned to accomplish this with a seperate physics scene and culling all objects in that scene from my normal cameras. Then I have a camera in the portraitscene that only renders objects in the scene.

I do not want to change the layer, since that is used by physics and triggers. But I thought I could just change the renderLayerMask of the GameObjects renderer and have a custom forwardRenderer that only renders that renderlayerMask wih opaque layer mask and transparent layer mask.

But this was not how it worked, very confusing that the renderLayerMask is ignored by the LayerMasks setting in the forwardrenderer.

Hiya, just a casual check to see if there’s any updates on this discussion. I see some PRs were last modified in December, but since there have been other priorities as mentioned above, I’m wondering if there’s any chance on it entering the roadmap soon or if it’s just a concept so far. Rendering Layers seem like a match made in heaven for URP, so I’m definitely looking forward to this as well.

I also wanted to point out that this comment added on the PR…


I believe it's better change it to 64 bits now, than waiting a few years when URP has been widely adopted and would potentially break a lot of projects. Don't do the same mistake that was done with the physics layer mask.```

Deserves a lot of attention as well, since reserving more than half of the layers for internal usage seems limiting thinking as a long-term solution.
1 Like

For those who don’t want to click through and read, they are reserving 20/32 Rendering Layers for ‘internal usage’.

1 Like

Just to keep everyone updated: The PR for this feature is now closed, and it’s not exactly clear why. I am poking the devs for more information and will report back.

5 Likes

From what I understand in the PR it’s being pushed back to at least 2022.1…

1 Like