-
Notifications
You must be signed in to change notification settings - Fork 360
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
Add reflect node and toon shading example #1690
Add reflect node and toon shading example #1690
Conversation
Thanks for putting this together, @kwokcb! Since this proposal includes a |
As is "reflected" (pun intended) in the shadergraph documentation Jonathan links above, we would prefer to propose
I think using Internally we don't actually specify the default for While we're here, and because it's also public in the ShaderGraph docs (https://developer.apple.com/documentation/shadergraph/geometric/refract-(realitykit)). The
Thats basically what we've already started using internally. I believe that this is inline with what others think this should be - then we could also share the nodegraph implementation of this node as well. |
Sounds good to me. I originally had "viewdirection" and "normal" as inputs but changed them when I realized BTW @ld-kerley, someone should probably update the docs for
|
I'd recommend "reflected against" if that phrase works for you both, as in the following:
|
@kwokcb Should we take the additional step of using this new |
Hi @jstone-lucasfilm,
|
- Add uimin/uimax for light_direction.
For the For the For the Here is the language describing the behavior of the
And here is the corresponding language in OSL:
|
This is from MSL: Seems like GLSL, MSL, OSL indicate
|
That's an interesting interpretation of the text, @kwokcb, though it's exactly the opposite of my own! Taking the related snippet from your MSL documentation, they state "the surface normal N needs to already be normalized to get the desired results". I take that to mean that the caller is responsible for normalization, which increases the possibilities for optimization and numerical stability in MSL logic that would not be possible if the |
I would agree- it’s better to state in the Spec that the input vectors are expected to be normalized if that’s required for the math to work (and so the caller can insert a <normalize> node in the node graph before it if needed), than to add an internal normalization that in many cases would be superfluous and redundant.-DougOn Feb 4, 2024, at 1:31 PM, Jonathan Stone ***@***.***> wrote:
That's an interesting interpretation of the text, @kwokcb, though it's exactly the opposite of my own!
Taking the related snippet from your MSL documentation, they state "the surface normal N needs to already be normalized to get the desired results".
I take that to mean that the caller is responsible for normalization, which increases the possibilities for optimization and numerical stability in MSL logic that would not be possible if the reflect method automatically normalized its input.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
It was the reflect statement for MSL that threw me off as it says it takes N and computes NN. I'll make the change to normalize outside. |
Sounds good, thanks @kwokcb! |
@kwokcb - thanks for flagging the docs - I had also noticed that on Friday and flagged it internally. +1 for normalize outside the node - Here is the OSL code direct from the repo - it clearly expects things to be normalized already. If I have cycles this week I'll see if I can put up a complementary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, thanks @kwokcb!
cff9a7c
into
AcademySoftwareFoundation:main
Changes
<reflect>
node to compute reflection across a planes normal<reflect>
node.Results
Graphs
New <reflect> graph
Updated <gooch_shade> graph