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

mesh object will not affected by the Light with specific values Material settings #53027

Open
snougo opened this issue Sep 24, 2021 · 4 comments

Comments

@snougo
Copy link

snougo commented Sep 24, 2021

Godot version

3.3.3 and 3.4 beta5

System information

macOS 10.14.6 intelGPU GLES3 and GLES2

Issue description

When setting Spatial Material with value 1 Metallic and value 0 Roughness, Mesh Object will not affected by the Light. both in GLES3 and GLES2

in blender with value 1 Metallic and value 0 Roughness

Screen.Recording.2021-09-25.at.1.14.47.AM.mov

in Godot with value 1 Metallic and value 0 Roughness

Screen.Recording.2021-09-25.at.1.15.16.AM.mov

Steps to reproduce

see Minimal reproduction project

Minimal reproduction project

bug report.zip

@Calinou

This comment has been minimized.

@clayjohn
Copy link
Member

@Calinou The specular blob calculation is skipped if roughness is 0.0

if (roughness > 0.0) { // FIXME: roughness == 0 should not disable specular light entirely

You can see that, while this was partially intended, the original author didn't think it was correct (hence the comment).

@Calinou
Copy link
Member

Calinou commented Sep 24, 2021

@clayjohn I see, I was referring to this particular bit in 3.x's GLES3 shader code:

diffuse_light *= 1.0 - metallic; // TODO: avoid all diffuse and ambient light calculations when metallic == 1 up to this point

In master, the same line exists but it doesn't have a comment:

@clayjohn
Copy link
Member

@Calinou Remember that there are 2 primary sources of light, diffuse light and specular light. Metallic surfaces don't have any diffuse light, it is all specular. The code you link is what ensures that there is no diffuse light for metallic materials.

The issue OP posted about is a missing specular blob when compared to Blender.

@Calinou Calinou added bug and removed documentation labels Sep 24, 2021
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

3 participants