MaterialX - direction to eye vector
7109 9 1-
- rangi
- Member
- 306 posts
- Joined: 7月 2005
- オフライン
-
- jsmack
- Member
- 8173 posts
- Joined: 9月 2011
- オフライン
-
- rangi
- Member
- 306 posts
- Joined: 7月 2005
- オフライン
-
- rangi
- Member
- 306 posts
- Joined: 7月 2005
- オフライン
-
- rafal
- スタッフ
- 1471 posts
- Joined: 7月 2005
- オフライン
There was some talk about fresnel in MaterialX on ASWF Slack:
Yes, the fresnel node was removed in 1.38 in an effort to limit the support for view-dependency in MaterialX shader graphs. When view-dependent nodes are allowed to be used anywhere in a shader graph it makes it hard to support for bidirectional rendering techniques, where reciprocity is a strict requirement. So in order to keep MaterialX as portable as possible to all different renderers we decided to remove the nodes: fresnel, viewdirection and backfacing.
In practice this restriction was introduced in MaterialX 1.38 by the MDL back-end, because MDL has no support for general view dependency, because of its requirement to support bidirectional path tracing. So fresnel, viewdirection and backfacing was not possible to implement in MDL, and any shading graph containing them would not be portable.
But I think it's a fair point to say that something like a facing-ratio node would be very useful. I think we need to discuss how something like that could be introduced without breaking portability.
-
- jsmack
- Member
- 8173 posts
- Joined: 9月 2011
- オフライン
-
- Siavash Tehrani
- Member
- 734 posts
- Joined: 7月 2005
- オフライン
-
- jason_iversen
- Member
- 12986 posts
- Joined: 7月 2005
- オフライン
It would seem a bit self-limiting if the MaterialX guys scoped Mtlx to one style of rendering (bidirectional pathtracing) rather than allowing a broader implementation and potentially supporting more styles of render engines. Perhaps they could consider adding some sort of tag schema to Mtlx nodes with properties that an implementation could correlate with the abilities of their supported renderers.
Edited by jason_iversen - 2021年11月30日 02:33:25
Jason Iversen, Technology Supervisor & FX Pipeline/R+D Lead @ Weta FX
also, http://www.odforce.net [www.odforce.net]
also, http://www.odforce.net [www.odforce.net]
-
- brians
- スタッフ
- 583 posts
- Joined: 5月 2019
- オフライン
jsmack
Use the mtlx position to get I, and the mtlx normal for N, both in camera space ("space:camera")
"space:camera" is not part of the MaterialX specification.
https://www.materialx.org/assets/MaterialX.v1.38.Spec.pdf [www.materialx.org] (page 29)
I'll have a chat with others at SideFX to see if XPU should support it or not.
jsmack
I found using the geompropvalue to get 'I' also works, and works correctly in reflections.
'I' is not really a property of the geometry, so I don't think it would really be valid to have it come through via the geompropvalue. (again I'll chat to others at SideFX to see if XPU should support it)
IMO a better way to get the incoming ray direction is via the MtlxDot ray-import stuff (that works in both KarmaCPU and KarmaXPU).
https://www.sidefx.com/docs/houdini/solaris/karma_xpu.html#summary [www.sidefx.com]
So to do what you're asking, I would suggest...
- have a MtlxNormal node (set space to "world")
- have a MtlxDot node (put
ray:D
as the note), and multiply by -1, which will produce the equivalent of "I"See attached example + screenshot
Cheers
Edited by brians - 2021年12月7日 18:43:51
-
- brians
- スタッフ
- 583 posts
- Joined: 5月 2019
- オフライン
-
- Quick Links