Vex: How to use Snell's Law for Refraction Vector?
1031 11 0- olivierth
- Member
- 1007 posts
- Joined: April 2017
- Offline
- rafaels
- Member
- 696 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
- 670 posts
- Joined: Sept. 2013
- Offline
- olivierth
- Member
- 1007 posts
- Joined: April 2017
- Offline
- olivierth
- Member
- 1007 posts
- Joined: April 2017
- Offline
- animatrix_
- Member
- 4516 posts
- Joined: Feb. 2012
- Online
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]
youtube.com/@pragmaticvfx | patreon.com/animatrix | animatrix2k7.gumroad.com
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]
youtube.com/@pragmaticvfx | patreon.com/animatrix | animatrix2k7.gumroad.com
- olivierth
- Member
- 1007 posts
- Joined: April 2017
- Offline
- jsmack
- Member
- 7771 posts
- Joined: Sept. 2011
- Offline
- olivierth
- Member
- 1007 posts
- Joined: April 2017
- Offline
- jsmack
- Member
- 7771 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
- 1007 posts
- Joined: April 2017
- Offline
- olivierth
- Member
- 1007 posts
- Joined: April 2017
- Offline
-
- Quick Links