• Showcase
  • Trying integration of Spine + Sprite Lamp

  • Modificato
Related Discussions
...

Hello, anyone testing with this? I'm trying to integrate both tools, the "idea" it's very cool, but the execution at this point is far from what I want, anyway, here is a test:

Spine + Sprite Lamp test 01: http://www.youtube.com/watch?v=pOc4WbWnWgQ

Hope get the desired behavior soon, any feedback it's welcome.
:sun:

We backed Sprite Lamp, but haven't had a chance to play with it yet. Wonder if it will produce better results than Unity's lighting on 2D ..

We also backed Sprite Lamp, and also haven't had a chance try it out. You can see this thread and also the java-gaming.org thread linked from there.

You might contact Finn (Sprite Lamp guy) and see if he would work with you, especially if you are implementing this for a game toolkit and others would benefit.

That looks really great! 🙂

Very impressive. Thanks for sharing. I wonder how will it affect performance...

This looks great Gallo!

Have you tried Free Form Deformation on the maps that Sprite Lamp produces?
That would be so awesome 😃

Wow, looks really cool!

I would also be interested in performance information 😃 😉

I'm betting this isn't viable to shade my 3600 tiles on screen.... 😉

But it reminds me of the rim lighting from double fine adventures kickstarter- Broken Age.

CYBR Labs ha scritto

We backed Sprite Lamp, but haven't had a chance to play with it yet. Wonder if it will produce better results than Unity's lighting on 2D ..

What do you mean CYBR Labs? As far as I know, Sprite Lamp only produces the normal maps to be used for whichever engine. Right?

wrongtarget ha scritto
CYBR Labs ha scritto

We backed Sprite Lamp, but haven't had a chance to play with it yet. Wonder if it will produce better results than Unity's lighting on 2D ..

What do you mean CYBR Labs? As far as I know, Sprite Lamp only produces the normal maps to be used for whichever engine. Right?

Technically you could use the raw images of light shining on your 2d image in substitute of the pre-lamp image? right? I'm wondering if it could produce a better effect for lighting than Unity already produces?

Would be quite a lot of tedious work perhaps.. :think:

Another video with just little improvements and pants!, no big changes, this time in HD:
http://www.youtube.com/watch?v=vKby1IBrfCM

About mobile:

I didn't tried it in mobile but i think what we are seeing in this demo, even with more characters and scenario elements will work without problems in any "60fpsEpicCitadel" device. The impact can be the number of lights you use.

Moving forward:

I need to implement a material and lighting systems for my 2D engine in order to do something more than this demo. I haven't implemented the last Spine features yet like ffd, but I hope to do it at some point, I'm using my own C++ runtime. For sure ffd is 100% compatible with normal mapping, no issue here.

I think that the way to go for Desktop and modern devices (OpenGL ES 3.0) is using Deferred Lighting (with MRT), this way you avoid the performance impact that can appear having a lot of sprites and lights, making a single full screen sprite with all the transformed normals information, plus this is how you can achieve the self-shadow feature described in Sprite Lamp Blog, cause in Spine you use separate sprites, so you need to render those sprites normals to a single texture in order to share the required information to do the self-shadow cast.

5 giorni dopo

An advice for Unity users, I has been doing tests with Unity3D (the previous tests were done with in-house c++ engine), and I detected that the current Spine runtime for Unity3d sends all the skeleton slots as a single mesh, this means that all slots share the same Mesh Renderer component, this also means that all slots receive the same _World2Object matrix, witch only contains the skeleton transformation, not the slot transformation itself, so, the normals from the normal map can not be transformed to the slot space, making impossible to achieve the correct illumination effect.

Is anyone working on a different runtime or have plans to create a runtime where each slot use it's own mesh renderer component?

You probably want to use a shader to rotate the normals for each texture region drawn.

A runtime that uses a gameobject per attachment could be useful. I just worry about performance.

But normal maps work fine with typical 3D meshes, right? Apart from the vertex normals potentially being flipped with 2D meshes, why wouldn't it work for Spine's meshes? There must be a way to push the necessary data for the shader without resorting to 1 GameObject: 1 Attachment

Nate ha scritto

See discussion here:
http://www.java-gaming.org/topics/2d-no ... #msg288545

Similar topic, but in the case of Unity3D it's more about the runtime than a shader problem, how to get the algorithm to get the correct normal rotation is not an issue in the Unity3D shader I'm using, the problem is that this shader recives wrong information from the runtime cause only the skeleton transformation is passed as uniform to the shader for all slots.

The GameObject per Slot solution is because I want to "follow the rules" of Unity3D components, I mean, this is the standard Unity3D way of doing those things, we can of course be more imaginative and pass this information in a similar way we do in a regular 3D skeleton with bones and vertex, in this case: indexing the texture region transformations, assigning those indexes to each vertex and exposing the transformations and indexes to the shader.

But, to be honest, In some cases the skeleton we create in Spine can be used as a template, and what we have as a texture region is only a placeholder for adding our own attachments. So, having each slot or texture region as a separate game object is desired to meet some requirements. I know this is a topic for another thread, but having a component for each slot gives more versatility.

Aye, though the only reason the information is "wrong" is because the shader expects the gameobject transform to describe the transform applied to the whole mesh.

A gameobject based Spine runtime has pros and cons. It may be easier to integrate with other Unity features, such as your shader, setting an object as a child of an attachment so it participates in the skeleton draw order and bone transform, etc. The downsides are that it may be awkward, if not complex, to have gameobjects generated under the skeleton for each attachment. I also worry about performance. Dynamic batching has a limitations for number of attributes, transform scale (this isn't clear) and multi-pass shaders. I haven't personally compared performance of a single mesh versus many gameobjects, but someone else on the forums reported it to be pretty slower (FWIW). Still, if a gameobject-based runtime is useful enough, maybe the downsides can be tolerated. I do plan to experiment with it.

I wonder about using it as a template. I think you would need to make your gameobject the child of a generated attachment gameobject, since the skeleton is going to be tracking and manipulating the attachment gameobject.

Thank you for looking further into this for us Unity users, Gallo.
To be clear, when we're talking about slots here you mean the Sprite's different parts or attachments, right? Just want to understand the problem well and see if we can experiment with the runtime too.

Nate, when a shader causes overlapping of the parts, like in the following example, what's usually the problem?
 Loading Image

Slots aren't actually rendered, so I assume he meant region attachments.

It looks like you aren't using premultiplied alpha or aren't blending the premultiplied alpha correctly.