Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | YeOldeDM | |
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:
But in my game, the camera rotates along with the ship, and this is the result:
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