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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question CustomPassUtils.RenderFromCamera() does not render lighting from camera.

Discussion in 'High Definition Render Pipeline' started by DeificGames, Feb 1, 2023.

  1. DeificGames

    DeificGames

    Joined:
    Dec 12, 2015
    Posts:
    25
    It seems that RenderFromCamera re-uses the lights that were visible from the camera that is currently rendering, even when the cullingResults are set to a different camera's culling results.

    Is there a way to resolve this in HDRP?
     
    Last edited: Feb 1, 2023
  2. DeificGames

    DeificGames

    Joined:
    Dec 12, 2015
    Posts:
    25
    Camera Relative Rendering was the culprit.
     
  3. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    466
    How did you fix it? Relative rendering can't be disabled (without hdrp source code changing)
     
  4. DeificGames

    DeificGames

    Joined:
    Dec 12, 2015
    Posts:
    25
    Sorry for delayed reply.

    Unfortunately, it seems that the only current way to disable Camera Relative Rendering is to embed the HDRP package and edit the ShaderConfig file, then recompile HDRP's cginc. It was easy enough, only takes a few moments, but its a silly workaround to have to do. There should be some API for this, and there probably should be a toggle in the UI.