2D Normal Mapping with a rotating camera

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

I am currently trying to add some normal mapping to my project. Copy/pasting the shader from the 2D Normal Mapping demo, I have the current code:

uniform texture normal;
//normal maps expect Y-up, but 2D is Y-down, so must mirror this.
NORMAL = tex(normal,UV).rgb * vec3(2.0,-2.0,1.0) - vec3(1.0,-1.0,0.0);

All works just fine as long as my camera is not rotating:
enter image description here

But in my game, the camera rotates along with the ship, and this is the result:
enter image description here

What, if anything, can I do to make the normalmaps display correctly with a rotating camera?

can’t see images

volzhs | 2016-09-23 11:09

Fixed images. Hopefully.

YeOldeDM | 2016-09-26 01:03

Mollusca have a solution for your problem: Normal map vs Rotating Camera in 2D - Archive - Godot Forum

pospathos | 2017-05-19 10:34