• Runtimes
  • diffuse, normal & specular maps

Related Discussions
...

Hi all,

Thanks to Spine it just took me a couple of days to set up mostly everything needed for a basic jumpnrun game. :clap:

Right now I'm using the Spine runtime for SFML/C++. Lately I have introduced a simple light shader that supports diffuse, normal and specular maps. Now I'm wondering if Spine has a mechanism that allows me rendering my character (currently the 'spineboy' example) with 3 different textures: the default colored one, a normal map and - optionally - a specular map.
Do I just have to find the right buzzwords for Google to solve this issue or am I supposed to extend spine-sfml.* a little? 🙂

Thanks in advance!

  • msl

you can make your different maps for each of the images in your project. then use spine texture packer to create an (for example, normal ) texture

Creating and packing these textures is not the issue.

I am wondering which mechanism shall be used that allows rendering the same spine::SkeletonDrawable instance in 3 passes:

  • one normal map pass => for later use (render to texture)
  • one specular map pass => for later use (render to texture)
  • one diffuse map pass => rendered with light shader applied

Using 3 different instances of spine::SkeletonDrawable, each for 1 texture type, seems to be a really bad idea.

Im not familiar with SFML/C++ but in most or actually all GameEngines I know you can feed different texture maps into the shader within the GameEngine Itself. Engines like Unity or Unreal make this quite simple as their basic shaders have preset slots for corresponding maps.
recreating those Effects in Spine is not possible though- atleast to my knowledge

Thanks for the reply but that still does not answer my question. :think:

The main job of Spine is to align quads or rather textures (taken from a packed texture using the .atlas file) according to a skeleton state. The final result can be rendered - for example using SFML. For this task - amongst others - the class 'spine::SkeletonDrawable' has been provided.

I am asking for a mechanism that allows me to use 3 types of packed textures (a diffuse texture, a normal texture and a specular texture) for the same skeleton so I can pass the final result (a textured quad for each texture type) to my shader.
What I don't want is to have Spine calculate the bone kinematics 3 times.

I come from a 3D background and am not a programmer so I cant provide with code snippets- sadly
However- in 3D a mesh is flattend to a 2D space (UV Mapping) and every texture you assign to the shader gets displayed on the mesh and then deformed via the mesh deformation done by the skellton / animation.
to my understanding spine works in a similar way. so aslong as your atlas images can be layered on top of each other this should theoretically work.
Again, layering these images on top of each other is as easy task in most game-engines as they already provide everything you need.
If you need to write the shader by hand, Im afraid youl have to look into shader coding or that sort.

I'll pass this topic on to my colleaque and see if he can maybe help, but were working in GameMaker Studio and plan to maybe switch to unity, so I dont expect to much.

I do believe you really need to have a programming background to answer my question. 😉