-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
NME: fix wrong perturbed normals when using pre-existing tangents #13186
NME: fix wrong perturbed normals when using pre-existing tangents #13186
Conversation
Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). |
Snapshot stored with reference name: Test environment: To test a playground add it to the URL, for example: https://babylonsnapshots.z22.web.core.windows.net/refs/pull/13186/merge/index.html#WGZLGJ#4600 Links to test babylon tools with this snapshot: https://playground.babylonjs.com/?snapshot=refs/pull/13186/merge To test the snapshot in the playground with a playground ID add it after the snapshot query string: https://playground.babylonjs.com/?snapshot=refs/pull/13186/merge#BCU1XR#0 |
Should this not also apply to anisotropy and clear coat block ??? |
… nme-fix-perturbnormal-tangent
Cool thanks a lot, I am not sure to understand the impact of the breaking change you are mentioning ? Isnt it more like a bug fix as the materials won t be broken, just lit properly ? |
It's not a bug fix if The breaking change I'm speaking about is in the implementation on our side: the existing node materials using perturbed normals + pre-existing tangents would break if we implement the change. The users will have to fix their node materials to account for the change. At least it's what I think would happen but I didn't think about it too thoroughly, so maybe we should discuss about that issue. In any case, I think it's a different issue and we can merge this PR if it is ok. |
Makes sense !!! Let s chat on wednesday |
NME: fix wrong perturbed normals when using pre-existing tangents Former-commit-id: 6237dadc8ddb225b63ebfcd16805af2c79b2ef40
Fix #13182
Note that regarding tangents in the bump context we don't take into account the w component of the vector.
In the regular bump code, we use this component as a factor to negate the bitangent (the w component is normally either 1 or -1):
From
bumpVertex.fx
:We don't do it in the NME: should we? If yes, we need to discuss it, I don't see a way to do it without a breaking change...