Normal Mapping in 2D Animated Sprites?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Corruptinator
:warning: Old Version Published before Godot 3 was released.

Is there by any chance any way of giving the 2D Animated Sprites a Normal Mapping overlay effect to allow realtime shadows to be rendered almost similar to one of the Godot Engine’s Demo Projects: 2D Normal Mapping?

:bust_in_silhouette: Reply From: avencherus

With animation you can keyframe your materials/shaders. So you can click into it, keyframe the normal itself.

With an animation player you would animate your sprite’s textures, and then animate it’s normal maps that you’ve created.

Thank you for the information. However, what I had in mind was something that would be possible to do using the AnimatedSprite2D node since it’s been updated to support it’s own animation, rather than doing it old style using the animation player, but considering that the animation player may be the best option that you suggested, should this be done using spritesheets?

Corruptinator | 2016-10-25 20:02

AnimatedSprite won’t be able to handle that. From what I’ve discerned, it was made as a quick way to create simple animations for simple things. Like if you have background props and such. It would be much like making an animated GIF that plays on loop forever and never changes.

It has no special controls for it, other than it’s basic parameters.

From what I can tell there aren’t any helpers for spritesheets for shader parameters, but you can still use Godot’s atlases, so expect a lot of manual work, or having to code something specifically into the shader.

It’s up to what works best for you, Godot allows for a variety of approaches.

avencherus | 2016-10-25 20:13