offset grid by texture

Hello I currently have a grid of particles by using the set position sequential
and that looks good
now what i am trying to do is have that grid be offset by a texture and have that texture roll. If you see the attached I would like the (say y position) to be offset by how light the color is in the map.
then i can scroll the texture to look like rolling hills or something
This this possible? What should i be looking for to do something like this because i cant find anything on the web about it.

7554505--934054--render-taj-solidnoise.jpg

It should be quite simple - you just need to add Y offset based on noise.
First add SampleTexture operator and use normalized (0-1) position of particle relative to area of your grid, so If your grid is square placed on XZ plane with dimentions Rect(0,0,10,10), then particle with position Vector3(3,0,7) would be mapped to (0.3, 0.7).
Next you take result of sampling and use it as offset on Y axis (just override particle Y position) and this way you already have particles positioned like you want.
The last thing you need is to scroll noise by time, just add Time to UV like in normal shader with scrolling texture and it’s done. One more important note - overriding Y position must be done in Update block or Output, so it get updated every frame, not just once when spawned.

1 Like

thank you i was able to get it working. Now i dont think this is possible because vfx is on the gpu. but is there a way i can find then a game object his these particles? I thought about having a shader with a vertex offset that used the same timeing and map but i dont think i can get collisions from shader displacement.

Sorry, but I don’t understand the question, I can only guess it’s something about detecting collision.

yeah was wondering if the particles could detect a collision from a game object

If you mean other game objects/colliders, then as you said it would be hard, plus “collision” can mean many things:
it must just stop/drop on surface? or maybe there is physical simulation? friction or other things? do they collide with each other etc…

If you just wanted to put/project particles on surface from the top you can create camera and render depth into render texture and use it as Y offset like you did before.

it would be more when the game object collides with the particle the game object is destroyed and something is instantiated in its place.

Another thing i am looking for is i can get the particle ID is there a way to pass that particles location back to script