Jump to content

get attribute at UV position.


danylyon

Recommended Posts

Hi Guys

Is there a way to get an attribute at a certain UV position on a different geometry? In surface (shop) context.

I want to make my own vector displacement bake shader. For this to work I need the Position of the Target Geometry at a UV coordinate.

Link to comment
Share on other sites

Something like

vector getposition(float s, float t) ?[/CODE]

No.

But you can try to realize this through loops over point cloud: for each position check uvSource == uvTarget.

Edited by rsd
Link to comment
Share on other sites

Thanks for the answers

The primitive attribute VOP wants a file, attribute, primitive and/or uv. Does this not do what you need?

I tried it.. but it seems it needs BOTH, the prim number and the uvs. I don't know the prim number. Also It reads primitive attributes, I need the Position (which is a point attribute) :-(

Jesse: I'm talking about the texture coordinates.. on a per Vertex basis.

Roman: I looked into point clouds.. unfortunatly, you loose all kind of connectivity from the primitives.

Link to comment
Share on other sites

Why do you need primID? You want to make support Ptex?

Possible to store any variable in point cloud including texture coordinates and primitive id (int getprimid()). You need to bake pc from source geometry and then iterate over it in surface shader at target geo.

Link to comment
Share on other sites

Hey Dany, don't think its exactly what you're looking for, but I'm attaching a primitiveattribute-based solution (for 12.5 only), so you can at least see what they're talking about, and see if it might start to work for you. Note that the primitive attribute vop *does* pull point attributes, but the lookup is based off parametric UV's and not texture UV's. There are some new vops in 12.5 (in particular xyzdist) make it much easier to derive parametric uv's if you don't already have them.

parametric_UV_resample.hip

Edited by mdunkley
Link to comment
Share on other sites

Hi, thanks for the answers.

Stephen: Doing it first in VOP's would limit the map to Points. I'd need the values calculated per shading point.

Roman: I don't need the primID's.. Houdini seems to need them. :-) If I'd go the PC way.. I'd loose all connectivity of the Points. The PC just looks up the closest points but I needed the vertices of the primitive.

Michael: Thanks for the file. I see how the primitive attribute works now, cool. It still does a closest point lookup.. I'd need a look up with matching UV coordinates. Mhm..

I actually found a rather cumbersome work around. I render out a map with absolut object space coordinates on the target geometry. then reuse the map on the low res geometry and subtract the Positions of the low res geometry. The results at UV borders are not good though. Maybe PTex would solve this..

I kind of dissed the Idea to do vector displacement maps. I got simple displacement maps working well, they need 1/3 of the size and seem to get less coving problems. (the disadvantages are ok if the lowres geometry is fairly similar)

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...