Vex: How to use Snell's Law for Refraction Vector?
2829 11 0-
- olivierth
- Member
- 1185 posts
- Joined: April 2017
- Offline
-
- rafaels
- Member
- 702 posts
- Joined: March 2009
- Offline
r = asin(n2 * sin(i)/n1))... me thinks
Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
-
- Konstantin Magnus
- Member
- 723 posts
- Joined: Sept. 2013
- Offline
-
- olivierth
- Member
- 1185 posts
- Joined: April 2017
- Offline
-
- olivierth
- Member
- 1185 posts
- Joined: April 2017
- Offline
-
- animatrix_
- Member
- 5130 posts
- Joined: Feb. 2012
- Offline
You shouldn't have to invert the normals. I use the regular surface normal of a grid here to refract rays on to the floor:
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]
-
- olivierth
- Member
- 1185 posts
- Joined: April 2017
- Offline
-
- jsmack
- Member
- 8188 posts
- Joined: Sept. 2011
- Offline
-
- olivierth
- Member
- 1185 posts
- Joined: April 2017
- Offline
-
- jsmack
- Member
- 8188 posts
- Joined: Sept. 2011
- Offline
olivierth
I'm trying a simpler example and I still get weird results. My InAngle (theta 1) is 45 degrees (makes sens) but the resulting OutAngle (theta 2) is 135 when it should be less than 45. What am I not doing right? What am I not understanding?
-Olivier
the refract function doesn't take the IOR of the medium as an argument, which you've put in as 1.6
It takes the ratio of the outside medium to the inside medium, for air and glass it would be 1.0 divided by 1.6
https://www.sidefx.com/docs/houdini/vex/functions/refract.html [www.sidefx.com]
-
- olivierth
- Member
- 1185 posts
- Joined: April 2017
- Offline
-
- olivierth
- Member
- 1185 posts
- Joined: April 2017
- Offline
-
- Quick Links

