-
-
Notifications
You must be signed in to change notification settings - Fork 21k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TileMap NormalMap behaves incorrectly for transposed tiles #39851
Comments
Note this demo is GLES3. Out of interest I tried it in GLES2. It turns out the legacy renderer does the same as GLES3 (incorrect according to this issue), but the batching renderer does it correctly (i.e. flips the normal map). We'll have to decide on what the correct behaviour should be, I'll have look at the shader and see if I can work out why the legacy renderer is not flipping (perhaps this is intentional). Edit : I now suspect the best behaviour would be flipping and using the same text coords as the texture as GLES2 batching does (as it has to match up - consider an irregular texture), but also flipping the actual normals read from the normal map in the fragment shader so the lighting still makes sense in relation to the light and is not backwards. This current combination is not currently supported in any configuration, so it is a bit broken in this respect. However for cases where you are using normal maps, for the time being at least you could duplicate the variations of the texture manually in the texture atlas. |
Godot version:
v3.2.2.stable.official
OS/device including version:
Ubuntu 18.04.4.LTS
Issue description:
When using a TileMap with a normal map and a Light2D, transposed cells do not take the light correctly.
Using the following cell texture, normal map, and Light2D:
The following behaviour is observed:
Steps to reproduce:
Minimal reproduction project:
Bug demo.zip
The text was updated successfully, but these errors were encountered: