Displacement Map and Attribute VOP

   7239   4   1
User Avatar
Member
351 posts
Joined: June 2016
Offline
Suppose I have geometry piped into the first input of a Attribute VOP. And a displacement map (greyscale image) feeding into the 2nd input.

The displacement map is actually coming from a cop2net.

Inside the Attribute VOP how would I use the displacement map (2nd input) to actually displace the geometry(1st input)?
Edited by art3mis - June 18, 2017 08:01:36
User Avatar
Member
8173 posts
Joined: Sept. 2011
Offline
I wouldn't do that, unless there were some reason to convert the image to geometry first, (which is what the output of a cop2net in sops is.) To apply displacement from an image, using an attribute vop, I would read the image directly into the vop using a texture node with uv connected to the texture uv input. For the image file path, a reference to the cop2net can be used to avoid writing the image to disk first, such as op:/../cop2net
Note:
UV coordinates are often stored as vertex attributes in Houdini, where as position is a point attribute. This means uv will be unavailable for binding in the same context as P, requiring extra steps to apply image displacement in sops (which needs both uv and P.) The easy method that works well if uv coordinates have seams is to compute the displacement vector (delta-P) in an attribute VOP set to run over vertices, and bind for export deltaP instead of P. Promote deltaP to point attribute using an attribute promote sop. Finally, add deltaP to P in a point wrangle or attribute vop to apply the displacement to points.
There are other ways to do this using fewer nodes, such as looping over arrays of vertices in a single attribute wrangle/vop.
User Avatar
Member
351 posts
Joined: June 2016
Offline
Thanks! Partially understand. I'm assuming you mean use 2 Attribute VOPs, the first run over vertices to retrieve UV coordinates, and the 2nd VOP to actually apply the displacement?

I've tried to accomplish the first part, get UV's in attribute VOP run over vertices, but confused by “ and bind for export deltaP instead of P.”

What changes would I make to the attached screen grab to accomplish this?
Thanks again!

Attachments:
inside_attribute_VOP_0verVertices.png (47.5 KB)

User Avatar
Member
351 posts
Joined: June 2016
Offline
I've attached a second .hip containing a simple example and 2 corresponding screenshots. In the first screen shot you can see I am iterating over vertices on the Attribute VOP. In the 2nd screen shot inside the Attribute VOP I am trying to compute my displacement vector for all the vertices.

The Texture SOP points to my Displacement map, a greyscale image.

What am I missing to make this work? Can any VOP experts possibly help?
Edited by art3mis - June 18, 2017 13:48:37

Attachments:
Compute_displacement_vector_1.png (50.0 KB)
Compute_displacement_vector_2.png (82.2 KB)
COmpute_displacement_vector.hiplc (211.5 KB)

User Avatar
Member
1 posts
Joined: May 2025
Offline
HI,
is it possible to connect layer rgba that exist in material in place of texture map in attr vop ?
  • Quick Links