nimao

Hi,

I tried to find something about it in the forum but i couldn't find anything.
i have an object which has a glowing texture which fades the alpha from 0% to 100%.
the fading texture is above an another texture. And when the fading texture is at halve of the alpha it seems to getting dark in unity but not in Spine.

I tried tif vs jpg because i read something about Pre-Multiplied Alpha or something but
that didn't work ether.

SpineProblem.jpg
nimao
Posts: 6

Shiu

I'll get Mitch on the batmobile, he should be able to help out :)
User avatar
Shiu

Shiu
Posts: 2183

Pharan

Mitch, you're up.

Just for diagnosis' sake, can you show us what shader you're using for the Material? And also the png's import settings in Unity?
I'm not sure if Spine Editor itself uses PMA. But if it does, and you're using PMA too with the Spine/Skeleton shader in Spine-Unity, theoretically, they should look the same.

There's likely no reason to use .tif though.
User avatar
Pharan

Pharan
Posts: 4542

Mitch

In my experience you shouldn't animate the alpha of a Glow texture. You should use a black background and put the glow on top of it and set it to Additive in the Spine slot* properties. When you want to glow/unglow it, animate the Color from White to Black rather than the Alpha. This plays nicer with additive blending. I have no idea what Spine is doing to make it look "Right".

---



The fireball has no alpha in its texture what so ever; black background with stuff painted on top.



This is what the exported atlas' alpha looks like for the mage.

Comparison with a glowyball instead

Glowyball source


And my regular workflow for making glowballs.
http://www.xdtech.net/spine/Greenball.psd
User avatar
Mitch

Mitch
Posts: 966

Nate

Spine just uses PMA and proper blending. :)

Additive will often look nice, but it depends on the background. The glow will look great on a black background, but you won't be able to see much on a brighter background.

Replace your glow ball image with a huge cow image and see if it fades like you expect.

User avatar
Nate

Nate
Posts: 7647

Shiu

Huge cow image solves everything :)
User avatar
Shiu

Shiu
Posts: 2183

Mitch



Let's be brovines.
User avatar
Mitch

Mitch
Posts: 966

nimao

thaaanks for all the help!

we use spine with tk2d in unity could that be the problem?

i tried out the additive solution but in unity i can add only one shader so the glow doesn't show up or the whole thing glows. Or is there a way to add two shader? or is it because we use tk2d?


import settings and material/shader:
textures.png
nimao
Posts: 6

Mitch

Bah, no one says "TK2D" until after I post lol.

Anyway...

Make sure you have TK2D Premultiply Alpha checked


And you can use the Spine Skeleton shader. The TK2D shaders don't use the same methods as the Spine editor so if the goal is to keep everything looking the same, you should use the provided shaders :)



PS:
I just updated the TK2D runtimes to be more in-line with the Spine-Unity ones.

They're available here and on Git.
http://www.esotericsoftware.com/files/r ... itypackage
There are a couple bugs, make sure when you create a SkeletonDataAsset that you assign the tk2dSpriteCollectionData before the JSON or it will have a bad day.
User avatar
Mitch

Mitch
Posts: 966

nimao

Awesoooome! it worked! thanksss!
nimao
Posts: 6

Mitch

nimao wrote:Awesoooome! it worked! thanksss!
:handshake:
User avatar
Mitch

Mitch
Posts: 966


Return to Editor