Sevro Posted May 17, 2021 Share Posted May 17, 2021 Is there a way to access the parametric uv's on a surface? I can get the assigned uv's, but not sure how I can access the intrinsic/implicit uv's for a shape? Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted May 18, 2021 Share Posted May 18, 2021 The VEX functions xyzdist() or intersect() return primitive numbers along with intrinsic UV locations. Interpolated attribute values can then be obtained using primuv(). Documentation: https://www.sidefx.com/docs/houdini/vex/functions/xyzdist.html https://www.sidefx.com/docs/houdini/vex/functions/intersect.html https://www.sidefx.com/docs/houdini/vex/functions/primuv.html Examples: Eg. transfer normals from the closest surface position of the second input: int prim; vector uvw; float dist = xyzdist(1, v@P, prim, uvw); vector nml = primuv(1, 'N', prim, uvw); Eg. transfer color attribute from ray intersection with another surface: float range = 1000.0; vector pos = v@P + v@N * 1e-3; vector dir = v@N * range; vector pos_hit; vector uvw_hit; int prim_hit = intersect(1, pos, dir, pos_hit, uvw_hit); v@Cd = primuv(1, 'Cd', prim_hit, uvw_hit); 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.