Manually sampling point cache for custom calculations in VFX graph

So I have a point cache with position and normals that I currently use for the position and velocity of my particles:
image

However, I would like to use those positions and normals to make custom calculations, instead of just directly setting positions and velocities. I tried to sample the texture with a random uv and using R as X, G as Y and B as Z, but it ends up all over the place. I feel it’s not encoded that way.

So my question is, how can I manually sample those point cache map and convert them to usable XYZ positions and normals? What’s the texture encoding of point caches?

Hi there. This is totally doable.
For this, you need to use operators to create your own custom logic.
The one that you are looking for is called “Sample Point Cache”.

Here, my point cache represents a Spiral curve. I’m manually sampling this point cache over time to feed set my initial particle position and move an Attractor Shape Sphere.

Unity_Ha2whOzpjX

If you want more information about pcache or the format by itself I would suggest that you take a look at those pages:

Documentation

pcache format

Have a great day

2 Likes