I don't even know where to fucking START with the bug I'm dealing with that seems to 100% be on Unity's end. I guess I'll start with what I'm doing and then talk about where shit seems to break
- I have an orthographic camera that views the entire battlefield from above. This camera renders two things to a render texture
- objects on the Fog of War layer, which are entirely white and unlit
- black
- none of those objects cast or receive shadows, as is my want
- a post processing shader takes this texture, reconstructs the world position from the main camera depth, and blacks out anything that isn't in the white areas the orthographic camera sees
this works perfectly! absolutely perfectly!
UNLESS
unless you disable shadows on the main directional light in the scene. the moment you disable those shadows, things get weird. like "wait, why the fuck is this happening? this makes literally zero sense" weird. turning off shadows just breaks the fucking fog of war. all of a sudden, the reconstructed depth positions break. lemme show with SICK GRAFIX
Here's the reconstruction remapped slightly to make it more readable with shadows on
Here's that same remapped reconstruction with shadows off
like what the cinnamon toast fuck is going on here? everything just fucking breaks
and that's not even the strangest part! because, see, if I run without antialiasing? I get the incorrect results. fxaa? incorrect results. smaa? incorrect results!
but if I use taa?
everything works without shadows enabled. but ONLY if temporal antialiasing (the worst kind of antialiasing) is enabled. then, if I switch back to fxaa, smaa, or no aa, it starts working again! but only until I stop playback, at which point everything goes back to the broken state
now the obvious solution here is that I just keep shadows enabled and turn the shadow strength to 0 if I don't want shadows for whatever reason, because that also works, but this bug is just absolutely the most confusing thing I've ever seen and I had to tell SOMEBODY
I'll just use the hacky way where I turn the shadow strength to 0. this isn't worth my time even if it's hitting a very particular part of how my autism manifests REAL bad
