RenderSingleCamera is obsolete but the suggested solution has error

Use RenderSingleCamera inside BeginCameraRendering get a warning:

“RenderSingleCamera is obsolete, please use RenderPipeline.SubmiteRenderRequest with UniversalRenderer.SingleCameraRequest as RequestData type”

It works fine, if use SubmiteRenderRequest instead will get an error:

“Recursive rendering is not supported in SRP (are you calling Camera.Render from within a render pipeline?).”

Same issue, in addition I get a spam of

State comes from an incompatible keyword space
UnityEngine.Rendering.RenderPipeline:SubmitRenderRequest<UnityEngine.Rendering.Universal.UniversalRenderPipeline/SingleCameraRequest> (UnityEngine.Camera,UnityEngine.Rendering.Universal.UniversalRenderPipeline/SingleCameraRequest)
Mirror:RenderCamera (UnityEngine.Camera,UnityEngine.Renderer,UnityEngine.RenderTexture&,UnityEngine.Rendering.ScriptableRenderContext) (at Assets/Scripts/Mirror.cs:172)

errors in the console (even though the script seems to be working).

Hey there, thanks for reporting this issue.

We reverted the obsolete status and RenderSingleCamera will soon be usable again while we are looking for a better solution.
Another workaround is to render your single camera via RenderRequests but in a MonoBehaviour. Then you can bind the result to whatever material or pass you needed in the actual camera rendering.

The issue here is that we saw a lot of bugs from users concerning RenderSingleCamera by using it in undefined manners. We made the RenderRequests as a more robust system but the workflow is less ideal for your use case.

Hi,

Can we make use of the RenderSingleCamera still or is not safe, e.g. is going to be removed again ?

Also please if possible not change such crucial features as can break things in a massive unrecoverable ways

RenderSingleCamera will soon be usable again while we are looking for a better solution.

Which versions is this supported from?

Hi,

I get a warning message in Unity 2023 about replacing the render single camera URP method with some other method.

Is this a real warning, e.g. is planned to give an error in later versions ? Or this idea was abandoned ?

It is certainly very hard to replace this, as means write a whole different module which may or not work the same.

Thanks

bump

Hi,

Is there any update on this ?

Removing the single camera render may break a big number of things and render unusable whole projects, given the complexity of replacing something like this which is a massive change.

Can we have an update on what to expect on this front, so can prepare ahead of time ?

thanks

Hi,

Is there any update on this ?

Also would be great to know if the Standard Pipeline will indeed be removed in Unity 2024, as this can directly break every single user project and without that be a choice.

So i would have to stop of support of Unity starting with Unity 2024, as removing the standard pipeline is an unrecoverable kind of event and probably move to Unreal engine.

Thanks

@nasos_303 Just a heads up, robinDMUnity was last seen April 13th, 2023. I think you may need to ping someone else.

Thanks for the heads up, will check asap :slight_smile:

bumping this, as i get this warning still in 2022.3.7, is this going to be addressed ?

Thanks

Unity devs added the new API, didn’t even test it (1 year+), and just reverted the old method. It looks like a joke.

I saw they added the same API for hdrp. I sure this API doesn’t works on HDRP too :slight_smile:

I get the warning in Unity 2022.3.11 now, hopefully they wont destroy our projects with this massive change.

The reason for removal that some users misused it, is a strange one, you dont destroy 1 million projects because 2 projects were not programmed properly.

As for using a separate renderer feature to do all the renderings, this is extemely complicated vs just call the direct render now, would make things so convoluted for users that make zero sense to remove this convinience.

I tried to replace the render call ““RenderSingleCamera”” with just rendering the camera always, but seems that gives an error with 3d textures if assigned to the render target, so is not possible to replace.

That means that if this function is deprecated will be a massive disaster.

Any new updates on this? This seems to be the only place I’ve found about this issue.

It’s crazy how this forum is full of threads like this where noone including the people at Unity have any idea of how to properly address the issues they add to the codebase. How can this be a production ready engine if everything is broken like this.

I’d recommend using the old UniversalRenderPipeline.RenderSingleCamera for now. It seems to be the best way forward since they will probably never remove this api anyways since it would break everyones projects because there is no proper alternative.

You can also wrap the call into a #pragma warning disable CS0618 and you will hopefully never have to deal with this again.

I like to be optimistic too and do use it still, but given we have already the example of pipelines and Render graph, that do indeed break whole projects in an non recoverable way, could easily just remove it at any point.

And the most funny part is that imo the whole pipelines thing is totally and absolutely unnecessary, BiRP is still able to pull of all things pipelines can and much faster or vastly faster and easier in some cases, like image effects.

I develop recursive mirrors and portals assets for VR. (released on the store)

I’m running in to the same issue where replacing “RenderSingleCamera” with “SubmitRenderRequest” is throwing
“Recursive rendering is not supported in SRP (are you calling Camera.Render from within a render pipeline?).”
This is because I’m using it from a “RenderPipeline.beginCameraRendering” callback. Besides this error in the console everything is working as expected but I can’t release an asset that logs a console error obviously.

The only reason I have for wanting to replace “RenderSingleCamera” currently is because it does not render any worldspace canvasses. UI is this impossible to reflect in the mirror. “SubmitRenderRequest” does make the canvas render but i’m stuck with the error.

Moving SubmitRenderRequest outside of the beginCameraRendering callback (to LateUpdate for example) makes the error go away but then my reflection is running 1 frame late. (sampling the position of the mainCamera is from a frame earlier it seems)

So I would need a solution for either:

“RenderSingleCamera” to include the UI in the RenderTextures. (or a way to force this to happen)
or
“SubmitRenderRequest” to not throw an error about recusive rendering.
or
a way to move “SubmitRenderRequest” outside of the “beginCameraRendering” and still not be a frame late to present the renderTexture. (what other callbacks are there except for LateUpdate or the RenderPipeline events like beginCameraRendering?)

Any help is much appreciated.

Cheers man, came here for the same reason to solve this cause I was improving your asset for my own project :smile:
Thanks for the asset, it is very epic.

I guess the best solution for the time being is this and hopefully they won’t break it in newer versions.
Trying to solve the issue with SubmitRenderRequest seemed pretty complicated for no benefit…

#pragma warning disable CS0618
UniversalRenderPipeline.RenderSingleCamera(src, reflectionCamera);
#pragma warning restore CS0618