Some real quality shaders, thanks for all the hard work ToddRivers!
jimmylaskowski

- 18 juin 2017
- Inscrit 12 oct. 2016
Hey Pharan.
Yeah, straight alpha works fine and gets clean, nice artwork. I got hooked on the idea of using PMA after reading your write-up on it. This problem got me interested in why it did not work and if there was any good answer to why, but it is not a big loss if I am using straight alpha instead.
- Modifié
Problem with black borders around sprite parts (neck and hands in this case). Been very careful to save out as PMA and tried different Spine Shaders but problem persists. Been reading the Straight Alpha/Premultiplied Alpha thread several times but not any wiser. Problem related somehow to color space as Gamma Color Space renders out Spine PMA without black borders, but the Linear space we are using creates this problem. Turning off sRBG on texture import settings also gets rid of the black borders, but creates a washed-out white overlay effect on the sprite instead. Being able to use PMA in linear color space would really help out.
Ho ho hooooooooh my god that totally fixed it! I never even thought about that, thanks dude!
I'd need some pointers to be able to hand you the code. I can hand you this gif though!
The blinking light in the gif is the transparent, orange layer being turned on. It's actually set for zero transparency at the start, with a gradual increase, so it's pretty strange that there is a blinking effect. There is none at all in Spine itself.
I'll have to check out Todd's thread in more detail. Cheers!
Heyo
First and all, great job on expanding upon the Spine shaders in Unity. One day they were just in there and they are reaaaaally cool. Happy surprise!
Secondly though, I found an issue with using the Pixel-lit function in Unity together with transparency. In Spine I have a sprite panel that is animated to show it getting heated up. To simulate the up-heating I keep an Orange layer hidden in setup. At animation start I turn it visible and at the same time apply 0 slot opacity. At animation end the opacity is higher. Playing the animation the panel looks like it is getting warmer by getting more orange.
But Unity does not really like this combo. At animation start the orange layer is displayed at full setup opacity. Then for a couple of frames it goes down in opacity to match the real animation values for color alpha. Once it does the animation proceeds as expected.
The version I am running right now is 3.5.43. I looked through the changelog however and no mention was made of this specific problem.
- Modifié
- Modifié
Unity has an option to change from default Gamma Color space to Linear Color space. Changing to linear color space produces a bug that makes Unity's preview window and object inside the window very dark. This only happens with Spine objects, other preview objects such as sprites and materials show up fine.
- In Unity, go to Edit
Project Settings
Player
Other Settings
Rendering
Color Space
- Change from Gamma to Linear
(2.5. Restart Unity) - Select a SkeletonData object in Project view
- The Preview window is very dark
After looking around some I found a minimalistic shader that turned off the backface culling, and it worked! Cheers for pointing me in the right direction. In case anyone else is looking, here's the source:
https://forum.unity3d.com/threads/2d-sprite-shadow-shader-jagged-edges.383659/
I got some kind of warning talking about material property block, but in my case a restart was enough to put Unity on the right track again.
- Modifié
For shadow casting/receiving purposes I am using the standard shader in Unity. Most of the time it works fine, but in one of the exports the normal for one mesh is inverted. It happens when the the mesh becomes more complex by adding vertex points. If no vertex points are used in the mesh, the normal is pointing in the right direction without any problem.
I can't get my head around this since I've been using many meshes from before that are more complicated than this one without any problems.