Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question ShadowMap recreated in both deferred and foward passes (built-in render pipeline)

Discussion in 'General Graphics' started by Seantoy, Sep 9, 2023.

  1. Seantoy

    Seantoy

    Joined:
    Feb 26, 2015
    Posts:
    2
    Hi there. I'm helping a team out with a port to Android and I'm surprised to see that we're (re)creating the same shadowmap twice each frame:
    • Once for the deferred lighting pass
    • Again for the opaque objects drawn with a forward pass
    upload_2023-9-9_17-12-50.png

    Each time we're drawing the same items and producing the same shadow map. Is there a way for me to tell the forward opaque pass to use the shadowmap that was already made by the deferred pass? That would save us 4ms with the GPU I'm testing with. That's a nice savings for work we don't have to do.

    I realize we should have all objects in either the deferred or (preferably) forward pass but at this late stage in development that may not be feasible.