• Runtimes
  • [UE4]Applying normal map to Spine assests

Related Discussions
...

Hey everyone,

So I'm trying to add normal map to our assets, however I'm not 100% sure which material should I be applying those too. Should it be blend materials in SkeletonRenderer component? Should it be just added to the atlas?

you must make your own material for it. Open spine material, copy nodes into a new material and add the texture node connected to normal

Should I then use that material in SkeletonRenderer component?

Yes.

24 giorni dopo

Returned to this, but still can't figure out how to make it work. Can anyone provide a screenshot or a link of simple setup?

I'm afraid I don't have screenshots, but it is really just a matter of copying the 4 base materials here spine-runtimes/spine-ue4/Plugins/SpinePlugin/Content at 3.6 and then modifying them to take an additional texture parameter for the normal map plus rewiring the nodes to get normal mapping going. I'm afraid I can't help with the normal mapping nodes in the material itself, I'm not quite familiar with how UE4 does lighting.

Oh, so you need to add a normal map to all of those. This helps, thanks!


So, I'm still struggling with this. I've added the normal map as I would in a usual sprite, but it doesn't work properly and it looks like texture coordinates are off or something - https://gyazo.com/c47760ea2482287b60193ab66dbcffb4

I have a guess that this is somehow connected with the fact that there are additional Tex.coordinates there at the top, but not sure how to apply them.

Can anyone provide any ideas on that?

The materials that come out of the box with the Spine Runtime for UE4 don't implement any lighting what so ever (as indicated by the names of the material). I would assume you have to implement that lighting in the material as it's implemented in other lit materials in UE4. Does your normal map line up with the texture atlas page of your skeleton? Usually normal maps map 1:1 to textures.

Yeah, I've changed the original materials from unlit to default lit. Yes, they are aligned - as if I just used atlas page textures as sprites inside map instead of spine asset it is coordinated properly.

I'm guessing that it is due to the fact that texture from atlas is dynamically moved and I need to sync/move the position of the normal map too. Not sure how though.

No, the texture and UV coordinates of attachments are not changed at runtime. They are read from the texture .atlas file and used throughout the lifetime of the skeleton/atlas. You can confirm this by letting a material point to your normal map instead of the texture atlas page. Something else must be going on.