guycalledfrank / bakery-issues

Bug tracker for Bakery
4 stars 0 forks source link

No way to support Sprites or transparent textures with Bakery Volumes & URP #44

Closed Zurigan closed 3 years ago

Zurigan commented 3 years ago

I'm still learning shaders/lighting/etc. Apologies if this is something obvious or rehashing old ground.

For context: I'm building a 2.5D game that's using Sprites & Spine entities (trees, characters), looks like this:

image

The trees are Sprites, ground is a Plane with Bakery baked shadows on it, the character is made in Spine (a mesh renderer).

I'm trying to find a more performant way to light everything ... light probes & Bakery were causing headaches so I'm trying out Bakery Volumes instead. With the shader set to BakeryURPVolumeGraph (but ... surface changed to transparent, alpha clip set to 0.01, two-sided enabled in PBR master node) the scene looks like this:

image

So ... lighting from the Volume is working (cool!) but Sprites are opaque and seem to ignore the shader alpha clip. The Spine character works a little better in that some of the images from the atlas are being drawn as expected ... the blue/green blocks are from overlaid 'glows', this is the atlas:

image

So ... just to confirm what's happening here ... https://geom.io/bakery/wiki/index.php?title=Manual#Opacity does mention that Bakery only uses cutout (right?) so ... am I completely out of luck here? There's just no support for transparency?

guycalledfrank commented 3 years ago

Lightmapper itself shouldn't have a problem with opacity, it's just the URP shader, I didn't make a transparent version. Did you switch surface on the "PBR Master" node? And by alpha clip, did you mean the "alpha" value on it? The latter is not the clip value, but the actual input alpha value. Connecting the alpha channel from BaseColor to it seems to work:

image

image

Zurigan commented 3 years ago

Ah, I was missing the Alpha input into the PBR Master node. That fixed the transparency issues. Great!

Now seeing some other issues, will log those separately!