prim UV info from scatter SOp

   5996   1   2
User Avatar
Member
30 posts
Joined: July 2005
Offline

Houdini version 7.0.214

OK… I'm doing a thing.

I have a lattice deformation:
- point based guide geometry (not lattice)
- rest is a locked SOp of a skull
- deformed is the skull animating
- source is from a scatter SOp on the rest geometry - a million points.

This is slow, and yields rippled imperfections in transforming the scattered points to the animating geometry (due presumably to the softness of the basis functions). So, I thought I would use the pointdist() function to find in the rest SOp the closest primitive, and primitive UVs - to each scattered point, and then use those coordinates to look up the deformed position in the animating geometry. I figure this should give3 me faster geometry with more perfect coplanarity with the deforming geometry.

The trouble is: pointdist() is too slow to run on a million scattered points. I thought it would be sensible to have the scatter distribute this info as the points are being scattered by cooking the pointdist() info into attributes on the source to the scatter, and have the scatter SOP interpolate the attributes at point creation time, rather than trying to suss it after the fact.

But: I cannot see how to precook this sort of information into the source to the scatter so the prim index attributes will be interpolated to the scattered points. How can I get the prim number, and prim UV coords for a piece of geometry stuffed back onto the points for interpolation at scatter time? I tried an attribcreate SOp with the pointdist() function relating the points of a SOp to the prims of the same SOp, but it hangs - possibly because of the ambiguity of which adjacent prim should be reflected in the return.

I'd half expect to have the scatter SOp with an option to stuff index info from the source prim into the points during the cook.

Can anyone think of a good way to do this?

Many thanks.


-caleb

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
calebh@adelphia.net (home) - choward@imageworks.com (work)
http://howards.vigilante.net/Caleb/Personal/CalebMain.html [howards.vigilante.net]
“Live slow. Die old.” -Ronda
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
My avatar was rendered from PRISMS
User Avatar
Member
2199 posts
Joined: July 2005
Online
You could try putting a uvtexture sop on the rest geo and set it to face, and for the prim number add a attribute create set to primitive type, attribute value $PR and then promote it to a point attribute using first match. You'd need to unique all the points first though.
The problem is how to use that information to reconstruct the positions from the deformed geometry, the primuv function doesn't work with polys because it ignores the v parameter. Do you have a way of doing this?
I would have thought you'd need to store the barycentric coordinate of each point relative to the triangle the point is on.

Have you tried scattering points based on your own attribute rather than area, eg face uv texture, or your own area attribute, then you can just do the scatter on the rest and the scatter on the deformed and in theory the scatter points should be consistent.

Attachments:
scatter.zip (20.0 KB)

The trick is finding just the right hammer for every screw
  • Quick Links