Mesh Thickness in VEX with intersec(), improving my code

   183   1   0
User Avatar
Member
52 posts
Joined: Sept. 2012
Offline
So Far i was using this method in VEX to measure a thickness value, blur it after but as i could see some inconsistency, im looking for a more precise methods without having to do a render/baking…

Below is my actual code. Any suggestion for improvement?
Cheers

————————–

Measure Thickness

————————–

vector dir = normalize(@N) * -chf(“rayLength”);
vector hitPoint;
float hitu, hitv;

int ray = intersect(0, @P + dir*0.01, dir, hitPointt, hitu, hitv);

if(hitPt != -1)
{
f@meshThickness = distance(@P, hitPoint);
@Cd.r = f@meshThickness;
}
else
{
f@meshThickness = 0;



____________________________________________

Vincent Thomas (VFX and Art since 1998)
Senior Env and Lighting artist & Houdini generalist & Creative Concepts (Available shortly)
http://fr.linkedin.com/in/vincentthomas [fr.linkedin.com]
https://www.imdb.com/name/nm0859628/ [www.imdb.com]
Vincent Thomas
Senior Lookdev Lighter & Matte Painter / VFX Sup Creative Art Director
http://fr.linkedin.com/in/vincentthomas [fr.linkedin.com]
User Avatar
Member
52 posts
Joined: Sept. 2012
Offline
Okay, gave a little new try to this problem tonight and i found a solution tonight with some tricks, get a really good one now
After 3 years in Houdini, really starting to have fun now



____________________________________________

Vincent Thomas (VFX and Art since 1998)
Senior Env and Lighting artist & Houdini generalist & Creative Concepts (Available shortly)
http://fr.linkedin.com/in/vincentthomas [fr.linkedin.com]
https://www.imdb.com/name/nm0859628/ [www.imdb.com]
Edited by vinyvince - Aug. 3, 2020 18:08:36
Vincent Thomas
Senior Lookdev Lighter & Matte Painter / VFX Sup Creative Art Director
http://fr.linkedin.com/in/vincentthomas [fr.linkedin.com]
  • Quick Links