wave-harmonic / crest

A class-leading water system implemented in Unity
MIT License
3.4k stars 475 forks source link

Fix shadow sim running for all cameras #1094

Closed daleeidd closed 1 year ago

daleeidd commented 1 year ago

CBs on lights will run for all cameras so we need to restrict it to a single camera by adding and removing the CB using the camera events.

This broke XR spectator camera and could cause incorrect shadows in the simulation.

There is a possible Unity bug where the shadow input draw calls are duplicated and without any commands applied to them (including setting the render target).