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. Dismiss Notice

Resolved Changing Scene Breaks Custom Render Feature

Discussion in 'Universal Render Pipeline' started by xorblax, Mar 12, 2023.

  1. xorblax

    xorblax

    Joined:
    Jul 15, 2018
    Posts:
    25
    When I switch to a different scene, my custom render feature no longer works and the error
    "Attempting to get Camera relative temporary RenderTexture (width || height <= 0) via a CommandBuffer Cloud Render Feature in a Sriptable Render Pipeline." is thrown before
    "Trying to get a relatively sized RenderBuffer without an active camera."
    is thrown repeatedly every frame.
    I can't tell what is causing this as there definitely is a main camera. I know that commenting out commandbuffer.GetTemporaryRT will stop the error (but cause the feature to stop working)
    I'm using Unity version 2021.3.16f1 and URP 12.
     
  2. xorblax

    xorblax

    Joined:
    Jul 15, 2018
    Posts:
    25
    Nevermind, I fixed it. Putting in commandBuffer.Clear() (commandBuffer is name of CommanBuffer variable) after getting and executing cleared it up.