traggett / UnitySpriteShaders

An Uber Shader for rendering Sprites in Unity.
MIT License
784 stars 61 forks source link

Ambient Occlusion on flipped sprites #21

Closed FuyuSyogun closed 6 years ago

FuyuSyogun commented 6 years ago

Greetings and many thanks for the awesome shaders!

I've been playing around with Unity's Post Processing Stack in my 2D game. And I'm using the Sprite (Pixel Lit) shader from Unity Sprite Uber Shader. The problem is, the AO from the Post Processing Stack works fine on normal (unflipped) sprites: left, but isn't working on flipped sprites: right (I'm using the negative scale.x method to flip the sprites.)

I'm assuming this is yet another problem caused by Unity's sprite flipping...Everything else works fine including lighting, shadows and even Depth of Field, only AO. (I'm new to shaders so I'm not even sure this problem can be fixed with shaders.) Do you have any suggestions? Or are there any workarounds (like flipping the sprites some other ways...)?

Many thanks in advance and apologies if anything is inappropriate...

FuyuSyogun commented 6 years ago

Hi again, I found a workaround to this problem! The Multi-Scale Volumetric AO from Unity's Post Processing Stack v2 works perfectly with flipped and unflipped sprites!