Sample Texture Color

   1969   2   1
User Avatar
Member
385 posts
Joined: July 2018
Offline
is there a vex function to sample the color from a texture map?

int prim
vector uv

xyzdist(1,@P,prim,uv);
//primuv()?
//how do i get the color from the uv coordinates?

Attachments:
sample texture.hiplc (165.2 KB)

User Avatar
Member
461 posts
Joined: Feb. 2012
Offline
use an "attribute from map" so you can have a Cd attribute from a texture. You do not need the uvquickshade btw

then in the wrangle

int primid;
vector uv;
float dist;
 
dist = xyzdist(1,@P, primid, uv);
 
v@Cd = primuv(1,'Cd',primid, uv);
Edited by sepu - Oct. 20, 2022 20:15:14

Attachments:
houdinifx_ouTl3FmWLt.png (76.4 KB)

User Avatar
Member
686 posts
Joined: Sept. 2013
Offline
The colormap() function samples images:
https://www.sidefx.com/docs/houdini/vex/functions/colormap.html [www.sidefx.com]
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
  • Quick Links