Search Unity

Question Rendering shadows for hidden heads (manual shadowpass?)

Discussion in 'Universal Render Pipeline' started by HellsPlumber, May 26, 2023.

  1. HellsPlumber

    HellsPlumber

    Joined:
    Aug 17, 2014
    Posts:
    42
    Hi!
    I'm working on a VR project that allows custom avatars.
    However, due to the need to hide the avatar's head in VR, the head isn't appearing in shadows and I'm looking for help to work around this.

    I'm shrinking the avatar's head using "RenderPipeline.beginCameraRendering" then resetting the head size using "RenderPipeline.endCameraRendering".
    This is so it doesn't show in the player's camera and still properly renders in mirrors.

    However, using this method is preventing the head appearing the the player's shadow.
    As this project allows custom avatars, I can't count on the usual methods such as a separate head material or mesh.

    Is there a way I can manually trigger a shadow pass before shrinking the head?
    Or is there another solution I can take?
    Thanks for any advice!