Search Unity

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

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

  1. Churd

    Churd

    Joined:
    Dec 12, 2015
    Posts:
    126
    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. Churd

    Churd

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

    kripto289

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

    Churd

    Joined:
    Dec 12, 2015
    Posts:
    126
    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.