danylyon Posted May 6, 2013 Share Posted May 6, 2013 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. Quote Link to comment Share on other sites More sharing options...
stevegh Posted May 6, 2013 Share Posted May 6, 2013 The primitive attribute VOP wants a file, attribute, primitive and/or uv. Does this not do what you need? Quote Link to comment Share on other sites More sharing options...
tjeeds Posted May 6, 2013 Share Posted May 6, 2013 Are you talking about uv texture coordinates or parametric uv's (based on primitive numbers)? Quote Link to comment Share on other sites More sharing options...
rsd Posted May 7, 2013 Share Posted May 7, 2013 (edited) 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 September 19, 2013 by rsd Quote Link to comment Share on other sites More sharing options...
danylyon Posted May 7, 2013 Author Share Posted May 7, 2013 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. Quote Link to comment Share on other sites More sharing options...
stevegh Posted May 7, 2013 Share Posted May 7, 2013 I was doing something like this a little while ago. I did this in VOPs with an attribute and then rendered out the map using Render UV Object. Quote Link to comment Share on other sites More sharing options...
rsd Posted May 7, 2013 Share Posted May 7, 2013 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. Quote Link to comment Share on other sites More sharing options...
mdunkley Posted May 7, 2013 Share Posted May 7, 2013 (edited) 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 May 7, 2013 by mdunkley Quote Link to comment Share on other sites More sharing options...
danylyon Posted May 8, 2013 Author Share Posted May 8, 2013 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) 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.