I’m new with GLSL shader.
For a small project with the SFML (who is based on OpenGL), i try to add a normal map on my textures to make a better light effect.
For that, i have wrote a shader, who work fine, but i still have a problem.
When the render of a sprite is not transformed, i have the result that i wanted, but if i add a rotation on my sprite the normal don’t rotate.
For simple shapes, i can use the transform of the object to change the normal.
But this way don’t work on “complex” objects, like a tilemap.
Here i have the same border on the top and left of the block, but rotated. You can see that the light look to be facing the 2 tiles but normaly it’s just up.
Is there a way to know the transformation of an UV in the fragment shader ?
If not, is there a workaround ?
Here you can found the fragment shader that i use for the tilemap
Thanks for your help