-
-
Notifications
You must be signed in to change notification settings - Fork 35.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
NormalMap Shader: prevent branching #17598
Conversation
Thanks! |
@WestLangley Is possible find a way to turn #ifdef FRONT_SIDE
bool frontFacing = 1.0;
#elif BACK_SIDED
bool frontFacing = -1.0;
#elif DOUBLE_SIDED
bool frontFacing = dot( cross( S, T ), N ) > 0.0 ? 1.0 : -1.0;
#endif Thus it can be used in other functions like
|
Seems that is was implemented in I think that a face direction ( |
Why? |
We already have access to Also, |
I am creating a PR for show better the idea. |
@mrdoob is about to use this approach: |
@sunag yeah, would be nice to have a PR with your suggestion so we can discuss it there. |
As proposed in #17586 (comment).
/ping @JordyvanDortmont
/ping @sunag