-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Treat specular less than 0.02 as occlusion #63587
Conversation
You have my eternal gratitude! |
Nice work 🙂 The class reference should be updated to mention two things:
Also, it might be worth discussing for a future PR whether we should add a specular map property to BaseMaterial3D. |
The image for Specular = 0.0 Before is wrong. It's set to 1.0 instead. |
This is a very common hack used in almost all PBR renderers to allow removing specular contribution in dielectric materials
c7cae19
to
0c65ed3
Compare
Done!
Fixed :) thanks for letting me know |
Thanks! |
Closes: godotengine/godot-proposals#4818
This is a very common hack used in almost all PBR renderers to allow removing specular contribution in dielectric materials.
Filament calls it "Pre-baked Specular Occlusion". Essentially, a specular value of less than 0.02 is outside the realm of physical quantities, so that range is reused to signify occlusion. In effect, this makes the specular fade out when very low values are used and it does nothing when normal range values are used.
Importantly, this PR matches the behaviour with Blender, Unreal, and Unity.
Specular = 1.0
Before
After
Specular = 0.5
Before
After
Specular = 0.0
Before
After