GLSL beginner q. - geo to texture and back again

Hi all,

I’m just learning GLSL and I wanted to try out a little challenge where I am writing some geometry point positions to a texture and then back to the geometry (to transport animation) but all my geometry gets scrambled.

How would one approach such a thing?

So far I have geo → sopTo CHOP → chopTo TOP
→ sampler on Vertex Shader

I am testing this with an alembic that is animated - I’m recording the animation to a texture and trying to apply that to a static copy of the alembic (same source geo sans motion).

I am not quite sure how to match the vertex i’m manipulating with the pixel on the map.
I don’t have UVs on the mesh and since I think I want to work on each point rather than vertex should this be a vertex shader or a geometry shader?

…sorry this is pretty vague but even a generic overall approach would be helpful!

Thanks in advance!

…so I’ve added a point attrib using a Point SOP with custom attr ptnum = me.inputPoint.index;
I am using this to create a uv coord with:

in int ptnum;
...

float pt = float(ptnum);
vec2 uv = vec2((pt/3120.0), 0.5);

so each vertex should get it’s coordinates from the same pixel in the position map - is that correct?

The mesh deforms but is still scrambled (although now the primitives remain connected properly).