# Point to Prim Color

I’m coming from Houdini knowledge on this technique. this example works in houdini.

what im trying to do is to use a magnet and a metaball to scale down individual faces. like the attached picture.

So simple case; A plane->facet (unique points) ->point (to color points black) → magnet. then the mag gets the metaball input and I set the transform to 1,1,1 in the magnet turn affect position OFF and Affect point color ON. then I try to use a primitive sop with a color expression in the scale paramater with do transformations ON.

I can see that the plane gets white color around where the metaball is. but the primitive sop does not see the point colors. In houdini there is a way to use attribute promote to move the point color into the primitives. but this seems missing from touch?

anyclues how to go about achieve that effect?

this is from houdini but its what i need to do in touch.

change the point attribute into a primitive one. because the magnet works with point colors. and i need to propagate those changes to the primitives.

on second look. the facet sop - unique the points is not working properly? like not at all? is this broken?

The Facet SOP seems to be working for Polygons, what primitive type are you trying it with?

grid sop.

5x5 grid. 25 points.

then goes into a facet sop. unique points option is selected.

still 25 points. should be 64.

opp. was a mesh in the grid sop not a polygon. my mistake. original question still applies, how to promote a point attr to a prim attr.

trying to sort another method because it seems impossible to change a point color attr into a prim color attr.

I am now trying to use a material sop. so I apply the texture coordinates then make a ramp, connect to a phong, then connect to the material sop. so in the geometry viewer I can see that I get the colors that I want. but where are these color values and how to access them? they don’t seem to be point color or prim colors.

Ideally they would get translated into a primitive color so i can use the prim sop to scale the faces based on colors.

so the basic idea is i can scale the prim face using \$CG in the prim sop

so i can see the color in the geometry viewer but how to get the sops to access the color values?

the rendered colors lives on the GPU so its not accessible in SOPs. To do what you want youll likely need to use a GLSL shader to move the veritces around using the texture color.

really?

even though I can view the color at the sop level there is no way for me to access that?

my only other thought was to use a lookup table with a dat of sorts to look up the center of each primitive and cross reference that with the UV texture space to query the color value at that uv space. then use the dat to pipe the colors into a prim color attribute. Maybe that still has to occur in a glsl shader im not sure?

When it gets rendered it’s all pixels at that point, and has no notion of what polygons were used to generate them.

You could use a DAT with an expression in the Primitive SOP to replace the color, so that part of your idea works.
To generate the table of colors though, it depends what your source is. I’m not sure if any of those will run quickly if you are planning on animating the colors though.

Thanks for the help

will most likely be kinect camera depth input. so real time is a must. needs to be fast.

If I bypass the idea of using the prim sop. and just do all the work in the glsl shader maybe then would run fast, however personally I’m better using the sops and working at the geometry level. I really don’t know anything about glsl code. only other trick with glsl since it knows nothing of the original geometry, would be to displace the pixels inward in triangular chunks. so a straight displacement wouldn’t quite work as I’d want the look to be stylized. so if we are functioning in the glsl on the pixel level, i would have to figure out how to make groups of pixels in triangle shapes? or something to that effect.

In GLSL code you have the vertex and the pixel shader. The vertex shader knows about the vertices, and if you setup your normals as so they point in the direction you want the movement, you can offset the vertex position along the normal in the shader, using the color from the texture.

The SOPs in Touch are the same SOPs in Houdini, so they haven’t been upgraded to be real-time. They are good to do simple things, or setup your geometry, but anything complex won’t run well real-time.

kinda wandering off the subject here but how are plans to speed up the SOPs and make them into the geometry shader version of TOPs?

rod.

Sadly, still on the back-burner right now.

well, lots of fun stuff on the front-burner for now!
cheers,
rode.