-
-
Notifications
You must be signed in to change notification settings - Fork 21.7k
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
Regression: TBN Vector Fixes break writing sdf shader normals #100820
Comments
For more correct shadows you can add |
I have the impression that the shader built-in Does using If it does I think it's better that |
I am strongly of the opinion we should not compromise on the correctness of our tangent basis construction, especially when doing things the correct way means maintaining parity with the result users get out of Blender. If this is simply a matter of |
Normalizing the normal doesn't seem to help. Here's the full shader for reference, with the normalize added.
|
@StaydMcMuffin I fully get your perspective. I'm just concerned that a breaking change for many users' shaders may have sneaked in with #100441. It's absolutely clear that we need the correct Mikktspace tbn vectors in the glsl scene shader. When it comes to what's passed to the Godot shading language, there might be non-breaking alternatives. We could for instance expose the unnormalized tbn matrix via a new But there is a chance that the issue is somewhere else according to @basicer. Haven't got the time to take a look at #100441 in detail yet. |
Turned out to be a plain error on my part, nothing to do with normalization. When not using a normal map, the interpolated vertex normal was always used for shading instead of the one supplied by your shader. I've addressed this in #100859. |
Tested versions
System information
Windows 11 Vulkan 1.3.280 - Forward+ - Using Device #0: NVIDIA - NVIDIA GeForce RTX 3070 Ti
Issue description
The changes in #100441 break writing the normal in spatial shaders such that SDF raymarching doesn't work.
Steps to reproduce
Open the mrp project, a simple SDF raymarching example.
After #100441 :

Before:

Minimal reproduction project (MRP)
sdf.zip
The text was updated successfully, but these errors were encountered: