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 Mobile backend: Lights don't affect primitive meshes #55892

Closed
Tracked by #55871
mrjustaguy opened this issue Dec 13, 2021 · 4 comments
Closed
Tracked by #55871

Vulkan Mobile backend: Lights don't affect primitive meshes #55892

mrjustaguy opened this issue Dec 13, 2021 · 4 comments

Comments

@mrjustaguy
Copy link
Contributor

mrjustaguy commented Dec 13, 2021

Godot version

v4.0.dev.calinou [6d58b96]

System information

Windows 11, Vulkan, Nvidia Quadro K2000 461.92

Issue description

Lights don't work on the Mobile Renderer on non-pre-alpha builds.

Mobile Lights

This is quite possibly related to the specific GPU architecture, as Kepler GPUs are known to have plenty of issues with DX12 and Vulkan.
I don't have access to different GPU architectures that support Vulkan so I cannot test the theory out.

Do note - Changing shading of the mesh to Lambert and things like that don't fix the lack of lights.

Steps to reproduce

Create a Mesh and try to apply Lights to it.

Minimal reproduction project

Bug.zip

@Calinou
Copy link
Member

Calinou commented Dec 13, 2021

I can reproduce this on master 2a9dd65 (Linux, GeForce GTX 1080):

image

This only affects primitive meshes, not imported glTF scenes (level.glb.zip):

image

Adding a new StandardMaterial3D override fixes the issue:

image

My guess is that the fallback material is too dark in the mobile renderer.

Vulkan Clustered backend fallback material:

storage->shader_set_code(default_shader, R"(
// Default 3D material shader (clustered).
shader_type spatial;
void vertex() {
ROUGHNESS = 0.8;
}
void fragment() {
ALBEDO = vec3(0.6);
ROUGHNESS = 0.8;
METALLIC = 0.2;
}
)");

Vulkan Mobile backend fallback material:

storage->shader_set_code(default_shader, R"(
// Default 3D material shader (mobile).
shader_type spatial;
void vertex() {
ROUGHNESS = 0.8;
}
void fragment() {
ALBEDO = vec3(0.6);
ROUGHNESS = 0.8;
METALLIC = 0.2;
}
)");

I can't see any difference between the shaders though.

@Calinou Calinou changed the title Vulkan Mobile Backend: Lights don't Render Vulkan Mobile backend: Lights don't affect primitive meshes Dec 13, 2021
@Calinou
Copy link
Member

Calinou commented Feb 28, 2022

Note that this was not fixed by #58628. I tested the commit just before and after, and can confirm the issue is still present in both commits with the MRP linked.

What's strange however is that I can't reproduce this in a brand new project…

@lufog
Copy link
Contributor

lufog commented Feb 28, 2022

@Calinou, I think #58628 fixes the problem, but you need to delete project's .godot folder. Perhaps this data is cached?

v4.0.alpha.custom_build [54a777b] (previous build):
image

v4.0.alpha.custom_build [039ffda] (build with fix):
image

@Calinou
Copy link
Member

Calinou commented Feb 28, 2022

@lufog I see, I guess we can consider this resolved then.

@Calinou Calinou closed this as completed Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants