Gallo

  • 20 Kas 2019
  • 28 Mar 2013 tarihinde katıldı

    Hi FinalBossLeo, the technique and the shader is explained in this thread: Unity-Sprite-Lamp-BumpMapped-Spine-texture-regions-2138?p=17252

    As far as I know my implementation is outdated, I'm actually deeply immersed in other projects that do not use Spine, so I can't dedicate time to that project again. But you are not the only one asking me about it, maybe I can dedicate some time in the future to update the implementation for the last Spine Runtime and Unity 5

  • Slot Color view Empty tartışmasında

    It was just that nothing was being selected, I feel stupid :-.

  • Slot Color view Empty tartışmasında
    • Düzenlendi
  • Slot Color view Empty tartışmasında

    Version: 2.1.17 PRO Mac OS X

    Hello, I can't explain exactly how to reproduce this bug, but when I was customizing the interface moving the Slot Color view, it suddenly appeared empty, and now even if I close and open the view or restarting Spine, it continues empty, see the attachment for more information. Of course I was able to see the Slot color view before this issue.

    While waiting for a possible fix for this strange behaviour, is there a way to reset the GUI layout?

    Thanks.

  • Hi!! Don gallo! tartışmasında

    Buenas, el shader esta en un link ke postee en la explicacion.

    Sahder: http://pastebin.com/FPxm5GYt#

    Explicacion: viewtopic.php?f=7&t=2138&p=17252&hilit=Sprite+lamp#p17252

    No es un shader completo ya que solo funcionaba bien con una luz, el tema estaba en modificar el componente mencionado para pasarle la informacion necesaria al shader, si ese componente ya no existe, seguramente esa informacion se le puede seguir pasando al sahder pero desde algun otro lado.

    En cuanto al workflow como era para una demo simple fue el siguiente. Todas las imagenes de piezas del cuerpo las exporto desde spine a una sola textura conservando su rotacion original que es la de la pose por defecto. Luego en fotoshop simplemente me kedo con las siluetas de esta imagen y creo 5 copias, luego en cada copia pinto cada silueta como si recibiera luz de un lado concreto y la quinta desde el frente, para hacerlo rapido utilicé el barril de degradados de gris claro casi blanco a gris oscuro casi negro.

    Con estas 4 imagenes simplemente las paso por el Sprite Lamp y genero el normal map. Luego al normal map le puedes aplicar algun efecto para simular pintado a mano y tal.

    Espero que te sirva esta elicación, saludos.

  • Hi!! Don gallo! tartışmasında

    Hello, first of all sorry for the delayed response. The runtime i was using was the one published when i posted it, so, it is not the lastest one. I'm spanish so I speak spanish. Have you succeed in the implementation with the lastest runtime?

    The warning that says "Shader wants tangents..." it's very suspicious, maybe the tangent data is not reaching the shader for some reason.

    Thanks Nate, as far as I understand:

    vertex with 1 weight
    [ 1, 28, 85.33, -49.59, 1 ]
    num_bones, id_bone, pos_x, pos_y, weight

    vertex with 2 weights
    [2, 14, 13.02, -8.66, 0.28761, 19, 0.9, -8.62, 0.71238]
    num_bones, id_bone, pos_x, pos_y, weight, id_bone, pos_x, pos_y, weight

    Why I have one position for each bone? I mean, in a regular mesh the position is relative to the center (pivot) of the mesh right? why we have a relative (I suppose is relative) position for each bone? I would like to have the vertex position relative to it's mesh (as we have in regular meshes), I imagine I can get it from bone_position + vertex_bone_relative_position or something like that. I will look further in SkeletonJson and SkinnedMeshAttachment to understand that.

    Thanks for the response, we use our own C++ / OpenGL engine, as well as our own Spine runtime. For now, I'm totally lost about how the skinning information is stored in the JSON file, I think that's all I need to know to start with the implementation.

    Hello, we are improving our runtime to support the skinning feature, but I can't figure out where on the JSON this information is, I mean, when we export an skeleton with meshes that have weights in it's vertices, the only difference I see with a regular mesh is that the type says: "skinnedmesh" instead of "mesh", but the data is the same, plus "a wild attribute appeared" called hull, that is only a number and i don't know what it is for.

    We have GPU FFD working smoothly on our runtime, maybe we forgot something with the "hull" attribute, but it works, so I'm sure we can reach skinning too (GPU skinning of course), we only need some hints about the new JSON format.

    Thanks.

    • Düzenlendi

    Exactly the same error this morning exporting a .json for skeleton with some FFDs (maybe ffds are not related to the error), v1.8.40. We really need this fixed as soon as possible please.

    Thank you

    Hi everybody,

    This time i'm not posting about some esoteric experiment with Spine and Sprite Lamp 😉, this time I'm proud to announce that a project I has been working on with my mates at Bee Square has been released. Sheldon's Bedtime Stories: The Golden Trophy, an interactive eBook available in the App Store for iPad, it's an interactive story about how the hares stole the Sheldon's trophy and what Sheldon does to get it back.

    Link to the App Store (check your country's store to find the description in other languages ):
    https://itunes.apple.com/gb/app/sheldon ... 20817?mt=8

    And two videos here:
    http://vimeo.com/86911807
    http://vimeo.com/87103851

    As you can see it is designed for the family, a new way for parents of telling a tale 😉. All character animations and some particle effects has been done with Spine, It has been a very interesting project and I'm very proud about what we have achieved. I'm just the programmer behind the implementation, of course the illustrations and animations are from the Art Team, a very impressive work from my point of view.

    Please, Enjoy!

    • Düzenlendi
  • HonorBound Released tartışmasında

    Can I know how many people and roles are involved in the development of your game jmcguirk?

    • Düzenlendi

    Hello, this is an explanation of how I integrated Bump mapping for texture regions in the Spine Unity Runtime, to take profit from the normal maps generated with Sprite Lamp. This may be not the best way to do it, it is only how I done it, of course there may be better implementations. If you don't know what I'm talking about, you can see this video: http://www.youtube.com/watch?v=PyfMK6QSaVA or read the thread about this topic: http://www.esotericsoftware.com/forum/v ... f=5&t=2017

    What I have done is implementing a shader material that receives the necessary information to transform the normals from the texture map and use it to shade the pixel, the material can be downloaded here:

    http://pastebin.com/FPxm5GYt#

    Feel free to improve or modfy it to meet your needs. The main issue while trying to achieve this feature was to pass the rotation in texture region space to each vertex of the mesh generated by the runtime, to do so, I modified the runtime creating a new array for an unused vertex property in the Mesh object, the tangents array. All those modifications are done in the SkeletalComponent.cs file from the official Unity Spine runtime.

    First, I declared an array of float4 to save the extra information like this:

    //line 55:
    private Vector4[] vertexExtraInfo;
    

    This will be another vertex attribute, just like the colors and UVs. Then I initialized this array like the other ones before doing the mesh setup.

    //line 172
    this.vertexExtraInfo = new Vector4[vertexCount];
    
    //line 188
    Vector4[] vertexExtraInfo = this.vertexExtraInfo;
    

    Inside the "for" loop that transforms each vertex, I fill this extra info array with the vertex rotation and scale.

    //line 193
    for (int i = 0, n = drawOrder.Count; i < n; i++) {
    {
    	//[...]
    	uvs[vertexIndex + 3] = new Vector2(regionUVs[RegionAttachment.X3], 1 - regionUVs[RegionAttachment.Y3]);
    
    //line 222
    //vertex rotation and scale
    float angle = (slot.Bone.WorldRotation + regionAttachment.Rotation) * (float)Math.PI / 180.0f;
    float scale = slot.Bone.WorldScaleX;
    	vertexExtraInfo[vertexIndex] = new Vector4(angle, scale, 0, 0);
    vertexExtraInfo[vertexIndex + 1] = new Vector4(angle, scale, 0, 0);
    vertexExtraInfo[vertexIndex + 2] = new Vector4(angle, scale, 0, 0);
    vertexExtraInfo[vertexIndex + 3] = new Vector4(angle, scale, 0, 0);
    
    vertexIndex += 4;
    }
    

    Finally pass this information as the tangents array to the Mesh object, of course this is not a real tangent.

    //just after the previous loop
    mesh.vertices = vertices;
    mesh.colors32 = colors;
    mesh.uv = uvs;
    //add this
    mesh.tangents = vertexExtraInfo;
    

    And that's the trick, assigning the shader to the material and doing this little modifications to the runtime you can achieve the bump effect. I'm passing only one scale supposing unified scaling scaleX == scaleY, but you can figure out how to pass scales for X and Y.

    Enjoy!

  • Kilubu : Magic Potions tartışmasında

    Cool animations 🙂. I like the style.

    Well I finally found a way to pass the proper information to each vertex, getting the desired light.

    http://www.youtube.com/watch?v=PyfMK6QSaVA

    I'm using the "tangent" vector from the Mesh object to pass the rotation and scale of each vertex to the shader. Then in the shader I create a rotation matrix with those values, and then I transform the normal with this matrix.

    Still pendent making it works with multiple lights, seems something wrong in the material but not in the shader. DirectionalLights require a modification too.

    By example. As you can see in this video everything seems working, but if I change to an animation where bones aren't near it's default transformation and move the light, then appear the problem (see head and legs), region attachments pixels are shaded as if the slots aren't rotated by the bone, being affected only by the skeleton transformation.

    http://www.youtube.com/watch?v=lmoVfzz5P_E