- Editado
Spine + LibGDX + normal-map lighting: examples/references?
Hey guys, I'm using LibGDX and I've implemented a version of normal-map lighting in my game for the tileset/static objects: https://github.com/mattdesl/lwjgl-basics/wiki/ShaderLesson6
(example gif: https://imgur.com/2UVRqdJ)
Now I'm looking to apply the lighting to Spine animations. I'm aware there are hurdles to overcome, such as modifying the normals' value based on the Spine attachment's rotation.
I'm hoping to find some information/reference to help me out with this, or someone to point me in the right direction. I've read through all of the related posts on this forum, but most of them seem to be for Unity
Really appreciate any help! Thanks guys!
We have a simple normal map demo here spine-runtimes/NormalMapTest.java at 3.6
However, it doesn't account for rotation of attachments. I'm personally not aware of a solution for the rotation issue, maybe others on here know?
Thanks Badlogic
I messaged someone who was able to correct the normal-map values' rotation by creating a 3rd texture (texture 1 being the regular TextureAtlas, texture 2 being the normal-map TextureAtlas) that had each attachment color-coded. He then sent information on the bone/attachment (its rotation) through to the shader, matched it up based on the color-code, and "fixed" the normals based on that rotation.
Going to give it a try and I'll report back.