0
votes

I'm working on a vector field over perlin noise and I was suggested to boost it up using shaders. My graphics knowledge is still very basic but I would like to ask if my thinking how to do it is correct.

Here is what I have. (it is not the latest version with 3rd dimension, but You will get the concept I guess).

So I will pass attribute: time, and noise value to the vertex shader. Unfortunatelly Im using noise function from some library which requires positions that should be calculated every frame in the shader. Is it possible to output from the shader a variable with position calculated inside for every particle?

I've found also something like "https://github.com/ashima/webgl-noise/wiki" for generating the noise inside the shader, but how to update the particles x,y,z position after moving it by the field value and keep it for the next frame? GLSL shaders should also have built in functions for noise generation but i don't think You can use them with threejs?

Thank You for any advice in advance!

1
by your question, you are trying to reposition your particles to the original place after it reached certain value in x/y by random positions..is it. - Iam Coder
no. Just want to move them according to the value of the flow field - mjanisz1

1 Answers

0
votes

have a look in this example... http://threejs.org/examples/#webgl_terrain_dynamic it will give you some idea for noise creation with shaders and dynamic position of it....