Skip to content
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

Vulkan: Normal maps in 3D don't work #44872

Closed
Xartorx opened this issue Jan 2, 2021 · 1 comment · Fixed by #44910
Closed

Vulkan: Normal maps in 3D don't work #44872

Xartorx opened this issue Jan 2, 2021 · 1 comment · Fixed by #44910

Comments

@Xartorx
Copy link
Contributor

Xartorx commented Jan 2, 2021

Godot version:
7a16efc

OS/device including version:
Windows 10 / Nvidia GeForce GTX 1080 Ti (457.30) / Vulkan

Issue description:
Enabling "Normal Maps" on materials doesn't work and leads to render problems, and spams console with errors

Steps to reproduce:

  1. Load project
  2. Enable "Normal Map" on new_standardmaterial3d.tres material
  3. Look at the console

Minimal reproduction project:
Test.zip

@Calinou Calinou added this to the 4.0 milestone Jan 2, 2021
@Calinou Calinou changed the title Normal maps doesnt work Vulkan: Normal maps in 3D don't work Jan 2, 2021
@clayjohn
Copy link
Member

clayjohn commented Jan 4, 2021

Introduced by: #44614

This line renames NORMAL_MAP_DEPTH to normal_map_depth

actions.renames["NORMAL_MAP_DEPTH"] = "normal_map_depth";

While the shader expects a variable named normal_depth

The solution is to rename the variable in the shader to normal_map_depth here:


and here:
normal = normalize(mix(normal, tangent * normal_map.x + binormal * normal_map.y + normal * normal_map.z, normal_depth));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants