TOP -> SOP

we were trying to figure out how to make a pincushion style network without using the technique in the included example (which uses GLSL to offset the vert positions at rendertime)

right now, the only method i can figure out is using a TOP To CHOP to convert every row into it’s own channel, and then either a) reformatting the chop so it’s the proper format to use in conjunction with an Add SOP or b) access it directly using a Point SOP and a chopi() expression in the $TY field.

i thought there might be a way to apply the TOP to geometry using the Texture SOP, and then somehow access a single value from a texture correspondent to a point, but i’ve only been able to get to the UV coords using $MAPU,$MAPV.

so… is there any way to perform fast texture lookups in SOP contexts, before it gets to a shader?

You can also use the Channel SOP to convert CHOP data into SOP data.

Is the main issue here usability, or performance? The Channel SOP may be the easiest way to do this.

For performance the main issue here is that TOPs live entirely on the GPU, while SOPs live on the CPU. Reading data from the GPU back to the CPU is very slow (as you can see from the speed of the TOP to CHOP node). In the next build (coming soon) the TOP to CHOP will have the ability to do a delayed/asynchonous readback, which means the node will have last frame’s data, but the node will cook much faster.

However doing the texture sampling and vertex attribute modification in a GLSL shader will be orders of magnitude faster than any of these solutions (which is why pushpins did it this way).

Thinking far into the future, we’ll likely have a new breed of SOPs that live entirely on the GPU and are modified using CUDA/OpenCL. When these come around direct communication between TOPs/SOPs will be super fast.

yea performance is the primary concern, as the TOP To CHOP is pretty slow, and that’s what i suspected… thanks for the info!