Blog post: Finally an update
Sorry it's been a while, we should do blog posts more often to keep you up to date!
Page 1 of 1
Nate
8 years ago
-
Nate - Posts: 12219
bilalmirza
hey! awesome update, any idea when we will get our hands on cocos2d-x runtime with these features?
Thanks
Thanks
8 years ago
-
bilalmirza - Posts: 37
majzim
Great update man!
You mentioned normal maps support in your blog post. I wanted to know if spine will generate the normal map or do we have to use some other tool like spritedlite to generate that? Also, any idea when cocos2dx will start supporting the new features!
You mentioned normal maps support in your blog post. I wanted to know if spine will generate the normal map or do we have to use some other tool like spritedlite to generate that? Also, any idea when cocos2dx will start supporting the new features!
8 years ago
-
majzim - Posts: 29
Nate
spine-cocos2dx already supports all the Spine features! The fancy lighting that Unity does is specific to Unity, not really a Spine feature, because Unity does most of the lighting stuff for you. It's possible to do with cocos2d-x, you'd just have to implement it.
Spine doesn't create the normal maps. Like creating the other images used in Spine, you'd need to create them yourself with an external tool. There is Sprite Lamp and Sprite DLight that might help.
Spine doesn't create the normal maps. Like creating the other images used in Spine, you'd need to create them yourself with an external tool. There is Sprite Lamp and Sprite DLight that might help.
8 years ago
-
Nate - Posts: 12219
cybervaldez
This is awesome! Btw a quick suggestion related to the blog post since I almost missed it! Maybe make it more visible that the unity baking image is actually linked to a youtube video 

8 years ago
- cybervaldez
- Posts: 11
Ionog
Great!
One question, are the Unity tk2d Runtimes updated too?
Thanks!
One question, are the Unity tk2d Runtimes updated too?
Thanks!
8 years ago
- Ionog
- Posts: 4
Mitch
Not yet. I don't use tk2d for myself so they tend to lag behind heh. Most of the spine-unity features I write are things that I immediately need.Ionog wrote:Great!
One question, are the Unity tk2d Runtimes updated too?
Thanks!
8 years ago
-
Mitch - Posts: 978
Ionog
Ok, thanks!Mitch wrote:Not yet. I don't use tk2d for myself so they tend to lag behind heh. Most of the spine-unity features I write are things that I immediately need.Ionog wrote:Great!
One question, are the Unity tk2d Runtimes updated too?
Thanks!
8 years ago
- Ionog
- Posts: 4
chrismweb
Awesome, thanks for the blog post update! I'm switching to Unity, and the lighting tests get me even more excited about playing around in it
(and thanks for the links to the two different normal map generator tools).
Nice job, and I appreciate the hard work!

Nice job, and I appreciate the hard work!
8 years ago
-
chrismweb - Posts: 135
cybervaldez
Hi about the normal maps:
1. Are you using sprite dlight or sprite lamp in the example the video?
2. Author of sprite dlight and me were exchanging emails and he mentioned that the biggest obstacle is having a smooth transition on the joints when normal mapping, is that still an issue?
I need some advice concerning this
1. Are you using sprite dlight or sprite lamp in the example the video?
2. Author of sprite dlight and me were exchanging emails and he mentioned that the biggest obstacle is having a smooth transition on the joints when normal mapping, is that still an issue?
I need some advice concerning this

8 years ago
- cybervaldez
- Posts: 11
Mitch
Tests were done using sprite dlight. Smooth transitions with normals will always be rough unless you paint them not to be heh.
That being said, I added support for skinned mesh deformation of the normal map by taking the most significant bone for each vertex and passing its rotation to alic's shader as part of a tangent. So in that sense, not really an issue heh
That being said, I added support for skinned mesh deformation of the normal map by taking the most significant bone for each vertex and passing its rotation to alic's shader as part of a tangent. So in that sense, not really an issue heh
8 years ago
-
Mitch - Posts: 978
cybervaldez
Cool thank you, very awesome to hear that! 

8 years ago
- cybervaldez
- Posts: 11
Rouven
What is the workflow for normal maps?
Please correct me if I'm wrong, but it looks like we need to take the atlas generated by Spine, use a tool like Sprite DLight to create a normal map for the entire atlas and (likely) tweak it manually.
If we later add an image in Spine, the atlas is regenerated and we'll have to create the normal map again?
It would be great if there was a way to import normal maps into Spine alongside the regular sprites. Either with a file naming scheme, or from a Photoshop file (additional layer group for normal maps or something), and have the export generate a normal map atlas.
Rouven
Please correct me if I'm wrong, but it looks like we need to take the atlas generated by Spine, use a tool like Sprite DLight to create a normal map for the entire atlas and (likely) tweak it manually.
If we later add an image in Spine, the atlas is regenerated and we'll have to create the normal map again?
It would be great if there was a way to import normal maps into Spine alongside the regular sprites. Either with a file naming scheme, or from a Photoshop file (additional layer group for normal maps or something), and have the export generate a normal map atlas.
Rouven
8 years ago
- Rouven
- Posts: 6
Nate
If you had your normal maps as individual files, Spine would pack them exactly as it does the images, so the two atlases textures would match. If using whitespace stripping, you'd need to be careful that you have exactly the same whitespace in the diffuse and normal images. A tool that generates normals probably does this.
8 years ago
-
Nate - Posts: 12219
Mitch
The issue arises in that tools that generate normals don't do an artistically good job and only serve as a decent base layer. Painting inside an alpha mask can be rough with normals.
8 years ago
-
Mitch - Posts: 978
Nate
If you're using meshes then you aren't using whitespace stripping, so it's not an issue. Whitespace stripping is for the lazy anyway, just do it yourself before bringing images into Spine. 

8 years ago
-
Nate - Posts: 12219
Rouven
So basically I create a second project in Spine where I only import the normal map images, making sure everything is exactly like the images in the real project. And then I use that to only export the normal map atlas. Sounds like a feasible workaround, but it's a pain to maintain long-term.
8 years ago
- Rouven
- Posts: 6
Nate
No, much easier. You run Spine's texture packer on your folder of normal images.
8 years ago
-
Nate - Posts: 12219
Rouven
Thanks! That's a much better solution 

8 years ago
- Rouven
- Posts: 6
mikeboston101
thanks for this awesome update !
8 years ago
- mikeboston101
- Posts: 1
Stevepunk
I just realised I can bake to unity's default standards after watching this video which means I can use standard shaders.
This will save a massive amount of time!
[EDIT:]
Ok so I've tried using the standard shaders on a baked character but I'm getting some strange behaviour.
I've baked a lightmap for the goblin using sprite dlight..

But the results I'm getting are strange..

The point light is to the right so the lighting on the shield is correct (although it refuses to light from the top and bottom (only from left or right).
Despite the head being the same orientation in the atlas, it will only light from the left when the point light is on the bottom left.
On the body top and bottom lighting are reversed and side to side lighting doesn't work at all.
The left and right lighting works on the fist but the upper arm seems to have reversed lighting also.
Honestly, I'm at a loss here.
When the image is flipped (negative x scale), the same problems remain.
[EDIT2]
I did a test on the individual parts and normal mapping just to rule out any problems there (they share the exact same material as the goblin character).
As you can see with a point light on the X they are lighting correctly (even when rotated), but the goblin below still has erratic lighting.

Here's an example where I've rotated the planes to show the lighting remains correct.

So the problem with flipped/rotated normals seems to be the way in which spine rotates the objects.
As for the problem with normals only lighting on 1 axis I'm at a loss..
This will save a massive amount of time!
[EDIT:]
Ok so I've tried using the standard shaders on a baked character but I'm getting some strange behaviour.
I've baked a lightmap for the goblin using sprite dlight..

But the results I'm getting are strange..

The point light is to the right so the lighting on the shield is correct (although it refuses to light from the top and bottom (only from left or right).
Despite the head being the same orientation in the atlas, it will only light from the left when the point light is on the bottom left.
On the body top and bottom lighting are reversed and side to side lighting doesn't work at all.
The left and right lighting works on the fist but the upper arm seems to have reversed lighting also.
Honestly, I'm at a loss here.
When the image is flipped (negative x scale), the same problems remain.
[EDIT2]
I did a test on the individual parts and normal mapping just to rule out any problems there (they share the exact same material as the goblin character).
As you can see with a point light on the X they are lighting correctly (even when rotated), but the goblin below still has erratic lighting.

Here's an example where I've rotated the planes to show the lighting remains correct.

So the problem with flipped/rotated normals seems to be the way in which spine rotates the objects.
As for the problem with normals only lighting on 1 axis I'm at a loss..
6.5 years ago
- Stevepunk
- Posts: 11
Pharan
Have you tried packing the texture with rotation off?
Spine-Unity Docs Repo, and check out the Unofficial Spine Users Tumblr.
6.5 years ago
-
Pharan - Posts: 5366
Stevepunk
These are the default example models in the spine/unity runtime.Pharan wrote:Have you tried packing the texture with rotation off?
One I tried by baking in unity and one I tried with the default spine mesh and they both have the same issue.
I assumed the examples should at least work without repacking but I can try that..
6.5 years ago
- Stevepunk
- Posts: 11
Mark topic unread
• Page 1 of 1
Return to Editor
- All times are UTC