Wolatje

Hi,
we are using 2d spine characters in a 3d world with Ambient Occlusion postprocessing. Our problem is, that transparent slots with an alpha of zero are still somewhat visible. In the example screenshot, the ghostman is surrounded by sprites that should not be visible (alpha set to zero) until I fade them in at a later time.


Here are our settings:


Disabling write is not an option, since we really need it enabled for custom fog effects. Anyone got an idea on how to fix this?
Wolatje
Posts: 14

Pharan

SS Ambient Occlusion relies on the values written to the depth buffer.
As long as something is written to the depth buffer, it will be included in the effect.
This SSAO from depth setup is an all-or-nothing effect. So even semitransparent sprites cannot have "just a little ambient occlusion".

I think you want to slide the Depth Alpha Cutoff slider value higher so that more of the semitransparent things on your sprite do not get written onto the depth buffer. If the alpha is already at 0, I'm not sure at the moment why they are still included. I'll have to check how this shader writes depth. It's possible that it doesn't take vertex alpha into account.

Immediately though, note that even if you set the alpha to 0, the potential pixels are still being checked and calculated by the GPU (even if it's less calculation). This isn't specific to Spine.
So if you are hiding parts of your Sprite, it's better to disable/hide the parts altogether, instead of setting color alpha to 0. This way, their shapes will also not be written to the depth buffer.
User avatar
Pharan

Pharan
Posts: 5281

Wolatje

Thanks a lot for your reply!
It's weird indeed that something gets written at all, the alpha of the "invisible" sprites is already at 0. Would be really awesome if you could check the shader in question, this issue has been giving us headaches for days now.
True, we can disable the part after fading it out and we did try that out but still: While fading it out, it looks weird because of the SSAO.
Wolatje
Posts: 14

Pharan

Even if we took the vertex alpha into account, it the SSAO effect would still pop in and out abruptly right at the threshold value as you fade the transparency in and out.

Anyway, we'll have a look at the shader code.
User avatar
Pharan

Pharan
Posts: 5281

Wolatje

Ok, thx! Will try to find a work around :)
Wolatje
Posts: 14


Return to Unity