- Изменено
Light direction bug?
Hello there,
This is my first post on the forum so i'll quickly introduce myself at the same time as posting my question.
My name is Florent, i'm 28, i work for a game company in france and i'm actually learning how to use both Spine and Unity.
I've absolutely no knowledge in coding, i'm just a dumb 2D artist ^^
I did my very first animation with Spine and exported it in Unity, and instantly ran into a problem.
When i created a directional light source in the scene, my character was not being lit, then i started turning my light in every direction to see if at least it would do something, and it did.
Now my character is being lit, but only when the directional is pointing in the opposite direction (towards the viewer) which makes no sense.
I'm also thinking about future problems, what if i want my character to cast shadow on a background? I guess it won't work as the light is pointing in the wrong direction?
The material is "Spine skeleton lit", is this the right one to use?
If anyone already had and then fixed that problem, i'd be glad to hear about it ^^
Sorry if this question has already been posted, i searched the forum and found nothing about it.
Thanks in avance,
Flo
So, according to my dear developer colleagues, this might be related to Spine exporting meshes with inverted vertices, so Unity sees them backwards, that's why it doesn't show up in Unity.
If i set the shader to Standard, it doesn't show up at all, if i turn the object 180° i can see it, that's the only proof i got for now XD
I started reading through Unity's forum and it seems i'm not the first one to have this problem, a double sided shader could do the trick as they seems to explain.
We will try to look further into this, if we find a solution i'll make sure to share it.
Go into the advanced options for your SkeletonAnimation component and check front facing.
Thank you for your answer Mitch, but we just found a (somewhat) solution this morning.
However, something is really weird :
Checking front facing does nothing at all, but checking calculate normals actually fixes the problem.
We also tried it with the Spine example projects, in case i was the one doing something wrong, but the exact same thing happens.
Any idea on why it doesn't behave the way it should?
We are using Unity 5.1, maybe that's the reason?
Anyway, thanks for answering, at least for now it kinda works, that's all i need to convince my company to buy a Pro licence XD
Ah, cool! I had exactly the same issue. Front facing changed nothing, but calculate normals fixed it.
Is this as it should be, or is something wrong in the setup that should be fixed?
Hey Guy,
I do have a question about this. Well using the shader Spine/SkeletonLit , if the character is flipped we get a light error. Изображение удалено из-за отсутствия поддержки HTTPS. | Показать
Just by checking "Calculate Normals" in the character fliped it fixes the issue. Изображение удалено из-за отсутствия поддержки HTTPS. | Показать
Leaving the character not flipped with this option unchecked.
1 - So to make them walk change sides the "calculate normal" should be checked and unchecked by a script? How can i acess it?
2 - This other three options that i saw in the shader`s creator post, that he says to be checked, and if you do it wont work.
What they are for?
Calculate Tangent Изображение удалено из-за отсутствия поддержки HTTPS. | Показать
Front Facing