Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug RenderSingleCamera is obsolete but the suggested solution has error

Discussion in 'Universal Render Pipeline' started by yu_yang, Oct 29, 2022.

  1. yu_yang

    yu_yang

    Joined:
    May 3, 2015
    Posts:
    85
    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?)."
     
    Last edited: Oct 30, 2022
    RamType0 and webik150 like this.
  2. webik150

    webik150

    Joined:
    Mar 23, 2013
    Posts:
    62
    Same issue, in addition I get a spam of

    Code (CSharp):
    1. State comes from an incompatible keyword space
    2. UnityEngine.Rendering.RenderPipeline:SubmitRenderRequest<UnityEngine.Rendering.Universal.UniversalRenderPipeline/SingleCameraRequest> (UnityEngine.Camera,UnityEngine.Rendering.Universal.UniversalRenderPipeline/SingleCameraRequest)
    3. 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).
     
  3. robinDMUnity

    robinDMUnity

    Unity Technologies

    Joined:
    Oct 13, 2020
    Posts:
    8
    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.
     
    nasos_333 likes this.
  4. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,286
    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
     
  5. jimblackler0

    jimblackler0

    Joined:
    Jul 3, 2018
    Posts:
    4
    > RenderSingleCamera will soon be usable again while we are looking for a better solution.

    Which versions is this supported from?
     
  6. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,286
    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
     
    HaydeLudos likes this.
  7. HaydeLudos

    HaydeLudos

    Joined:
    May 2, 2018
    Posts:
    39
    bump
     
    nasos_333 likes this.
  8. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,286
    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
     
    StrangeWays777 and adamgolden like this.
  9. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,286
    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
     
  10. RyanCantCode

    RyanCantCode

    Joined:
    Oct 22, 2018
    Posts:
    7
    @nasos_303 Just a heads up, robinDMUnity was last seen April 13th, 2023. I think you may need to ping someone else.
     
    nasos_333 likes this.
  11. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,286
    Thanks for the heads up, will check asap :)
     
  12. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,286
    bumping this, as i get this warning still in 2022.3.7, is this going to be addressed ?

    Thanks
     
  13. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    501
    nasos_333 and aprilfooleowyn like this.
  14. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,286
    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.
     
  15. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,286
    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.
     
  16. guubebra

    guubebra

    Joined:
    Feb 24, 2021
    Posts:
    3
    Any new updates on this? This seems to be the only place I've found about this issue.
     
  17. WidmerNoel

    WidmerNoel

    Joined:
    Jun 3, 2014
    Posts:
    64
    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.
     
    kripto289 likes this.
  18. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,286
    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.
     
    kripto289 likes this.
  19. TomGoethals

    TomGoethals

    Joined:
    Jan 29, 2022
    Posts:
    46
    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.
     
  20. The-Wild-Fox

    The-Wild-Fox

    Joined:
    Jul 29, 2017
    Posts:
    7
    Cheers man, came here for the same reason to solve this cause I was improving your asset for my own project :D
    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....
    Code (CSharp):
    1. #pragma warning disable CS0618
    2. UniversalRenderPipeline.RenderSingleCamera(src, reflectionCamera);
    3. #pragma warning restore CS0618
     
    TomGoethals likes this.