Lindsay

Hey All,

I'm having issues trying to get the transparency to animate. I'm currently using the game engine 'stencyl', and unfortunately there doesn't seem to be much support for spine in Stencyl any more (developer of the extension has quit since Spine 3.8 ).

I've animated my opacity using the 'color' keys underneath the 'blending mode' within Spine. My current settings for this is below.
2020-01-22_14h02_04.png

2020-01-22_14h07_37.png


When I set up the Spine file inside Stencyl, everything works EXCEPT the color transparency. Even when I apply the transparency without any animations, it still doesn't seem to read it.

I'm hoping that its a settings thing for me since this is a pretty big deal to try and sort out. I don't want to use 'png sequence' since the file size is enormous, so if anyone has any input with this, that would be amazing!

I've also noticed another thing as well (not sure if it related or not), but the images seem to have black alpha around them when in the game. I have set the "premultiply alpha" as well, so I don't think it's that, and the images are NOT compressed (well, for the ones I'm testing anyway).

2019-12-15_19h15_54.png


here is it in game...

78784115_1964378220375423_6064576689051009024_n.jpg


Help would be appreciative.

Cheers!
Non hai i permessi necessari per visualizzare i file allegati in questo messaggio.
Lindsay
  • Messaggi: 3

Erika

Hello! I couldn't help but notice you have Premultiply Alpha active in your export settings. Make sure to also enable it at runtime! or to disable it if you're not interested in optimization :> that will make the dark color go away!

Premultiplied Alpha Guide
Avatar utente
Erika

Erikari
  • Messaggi: 3115

Lindsay

Hey Erikari! Thanks for the help. It looks as if turning off 'Premultiply alpha' got rid of the black sections, but it seems to be still having issues with the 'transparency'. The game runs every animation normally except for the transparency xD.
Lindsay
  • Messaggi: 3

Harald

Animated attachment colors are passed to the renderer via vertex colors, so it has nothing to do with textures or the texture packing export options.

Does Stencyl also ignore if you set the RGB part of the color instead of its alpha value, e.g. set it to red 255, 0, 0, 255?
If the RGB color part works, then there is a bug in the Stencyl implementation.
If it does not work, then it is either not implemented, or you are missing some setup parameter that enables transfer of these vertex attributes. Are you perhaps provided with any settings like Enable Vertex Color or similar?
Avatar utente
Harald

Harri
  • Messaggi: 4343

Lindsay

Thanks Harald for the reply. Yeah, the color works fine. I was worried that it would be the Stencyl side -_-'. I don't think there is a setting to enable vertex color :(

---

So an Update. The flash player works perfectly! It's only when it compiles to android.. hmmmm.
Lindsay
  • Messaggi: 3

Harald

Lindsay ha scritto:Yeah, the color works fine. [..] I don't think there is a setting to enable vertex color
If the RGB part of the color works fine, then it should already be set up properly.
Lindsay ha scritto:The flash player works perfectly! It's only when it compiles to android.. hmmmm.
Oh, that definitely sounds like a bug then.
Unfortunately, in the respective Spine stencyl code I see no obvious error, the alpha component seems to be correctly respected:
https://github.com/byrobingames/spinehaxe/blob/master/spinehaxe/platform/openfl/SkeletonSprite.hx#L300
You could try if setting the whole skeleton's alpha value to e.g. 0.5 and test whether this is working - if you find a way to set the skeleton's color in Stencyl.
Avatar utente
Harald

Harri
  • Messaggi: 4343

Dark Cloud

I'm having a similar problem here (webplayer). Does anyone have any suggestions?

I'm using:

  • Spine 4.0

<script>
  • showControls: false,
  • alpha: true,
  • backgroundColor: "#00000000"
Non hai i permessi necessari per visualizzare i file allegati in questo messaggio.
Dark Cloud Games
Avatar utente
Dark Cloud
  • Messaggi: 5

Nate

@Dark Cloud, please do not create multiple of the same posts. I have deleted your other posts. We will see your post no matter where it is on the forum. If you want more visibility, create your own, new thread rather than posting on someone else's topic.

Transparency seems to work just fine in your screenshot. Are those areas of your skeleton opaque in Spine?
Avatar utente
Nate

Nate
  • Messaggi: 12151

Dark Cloud

Hi Nate,

Thanks for the quick reply and sorry for the over post.
There are several layers and the intention is to create a shadow effect in the amination. But in WebPlayer the transparency goes through the whole body and changes from dark to light appearance.
Non hai i permessi necessari per visualizzare i file allegati in questo messaggio.
Dark Cloud Games
Avatar utente
Dark Cloud
  • Messaggi: 5

Nate

Are you using additive blending or tint black on the neck shadow? Additive blending over a transparent background will always give you transparent (described here). If you are rendering additive over other images, like the neck shadow, then you should get additive blending. I'm not sure why you'd get transparent instead. Maybe Mario has some ideas, he'll be here tomorrow.

If you try it in Skeleton Viewer then we'll know for sure that it's a spine-ts rendering issue (which I suspect).
Avatar utente
Nate

Nate
  • Messaggi: 12151

Mario

@dark cloud could you maybe send me the assets via email? contact@esotericsoftware.com
Avatar utente
Mario

Mario
  • Messaggi: 3249

Dark Cloud

Hi,

I appreciate the assistance. I was able to fix the problem by changing the Blending from "Multiply" to "Normal".
Working result in: https://www.darkcloud.games/careers/
Non hai i permessi necessari per visualizzare i file allegati in questo messaggio.
Dark Cloud Games
Avatar utente
Dark Cloud
  • Messaggi: 5

Mario

Then that's a bug in spine-webgl, which I'd like to fix. I see if I can create a repro skeleton, but having something confirmed that's not working from you would be great.
Avatar utente
Mario

Mario
  • Messaggi: 3249


Torna a Runtimes