» Particle water
This site relies heavily on Javascript. You should enable it if you want the full experience. Learn more.

Particle water

effect
Credits: dottore sanch

about

Particle water effect could be improve probably.

download

ParticleSelfCollide.zip
16.07.14 [16:24 UTC] by sanch | 1747 downloads
dx11 version
Show 1 older revisions

Older Revisions

ParticlesGPU_2d_Dynamic_FieldTexture.zip
29.05.12 [02:02 UTC] by sanch | 1531 downloads

androsyn 29/05/2012 - 03:49

great! having lot of fun with this patch ^^

Desaxismundi 29/05/2012 - 09:05

cool one!

sebl 29/05/2012 - 13:51

really awesome

lasal 29/05/2012 - 20:17

Grande Sanch!

m4d 30/05/2012 - 02:19

neat stuff :)

sanch 30/05/2012 - 03:49

Thanks guy
Surface tension could be add to the particle , but i didn't get it to work both at the same time yet , should'nt be that hard. http://en.wikipedia.org/wiki/Surface_tension
For other purpose it could use also different shape like quad , but then particle rotation should be add also ... not sure if it will work the same way with rotation.
also independant mass relative to syze would be nice and easy to implement.
To finish the Navier-Stokes things to get the nice curly things to get some kind of moving flow like in the fluid solver but i don't know if that's possible and navier stoke equation is still too complicate for me.

milo 30/05/2012 - 10:16

amazing stuff!

io 02/06/2012 - 15:41

At work already with special thanks to Dottore, Sanch and Unc, and no I won t buy ATI anymore

title
robi_h 01/08/2012 - 16:17

hey david, very cool and clever!!!

I modified your shader a litte just to tidy things up. Instead of writing the values for the circular spread i compute them.

const float PI = 3.14159265;
    const int samples = 12;
    float2 pNew ={0,0};
    float2 d_1n ={0,0};
    for (int i =0; i<samples ;i++){
        pNew.x = cos(((1.0f/samples)*i*2*PI))*0.5*radius;
        pNew.y = sin(((1.0f/samples)*i*2*PI))*0.5*radius;
        d_1n +=  pNew  * tex2Dlod(SampFields, mul(float4(posQueue.x+pNew.x ,posQueue.y+pNew.y,0,0), FieldsTransform)+ 0.5).b;
    }

instead of

float2 p1 = ( float2(0.5000 ,  0.0000)*radius);
float2 p2 = ( float2(0.4330 ,  0.2500)*radius);
float2 p3 = ( float2(0.2500 ,  0.4330)*radius);
float2 p4 = ( float2(0.0000 ,  0.5000)*radius);
float2 p5 = ( float2(-0.2500 ,  0.4330)*radius);
float2 p6 = ( float2(-0.4330 ,  0.2500)*radius);
float2 p7 = ( float2(-0.5000 ,  0.0000)*radius);
float2 p8 = ( float2(-0.4330 ,  -0.2500)*radius);
float2 p9 = ( float2(-0.2500 ,  -0.4330)*radius);
float2 p10 = ( float2(0.0000 ,  -0.5000)*radius);
float2 p11 = ( float2(0.2500 ,  -0.4330)*radius);
float2 p12 = ( float2(0.4330 ,  -0.2500)*radius);
 
    ////// add  brightness of all point arround particle position an multiply with direction from circular spread
    ////  
    float2 d_1n  =  p1  * tex2Dlod(SampFields, mul(float4(posQueue.x+p1.x ,posQueue.y+p1.y,0,0), FieldsTransform)+ 0.5).b;
           d_1n +=  p2  * tex2Dlod(SampFields, mul(float4(posQueue.x+p2.x ,posQueue.y+p2.y,0,0), FieldsTransform)+ 0.5).b;
           d_1n +=  p3  * tex2Dlod(SampFields, mul(float4(posQueue.x+p3.x ,posQueue.y+p3.y,0,0), FieldsTransform)+ 0.5).b;
           d_1n +=  p4  * tex2Dlod(SampFields, mul(float4(posQueue.x+p4.x ,posQueue.y+p4.y,0,0), FieldsTransform)+ 0.5).b;
           d_1n +=  p5  * tex2Dlod(SampFields, mul(float4(posQueue.x+p5.x ,posQueue.y+p5.y,0,0), FieldsTransform)+ 0.5).b;
           d_1n +=  p6  * tex2Dlod(SampFields, mul(float4(posQueue.x+p6.x ,posQueue.y+p6.y,0,0), FieldsTransform)+ 0.5).b;
           d_1n +=  p7  * tex2Dlod(SampFields, mul(float4(posQueue.x+p7.x ,posQueue.y+p7.y,0,0), FieldsTransform)+ 0.5).b;
           d_1n +=  p8  * tex2Dlod(SampFields, mul(float4(posQueue.x+p8.x ,posQueue.y+p8.y,0,0), FieldsTransform)+ 0.5).b;
           d_1n +=  p9  * tex2Dlod(SampFields, mul(float4(posQueue.x+p9.x ,posQueue.y+p9.y,0,0), FieldsTransform)+ 0.5).b;
           d_1n +=  p10  *tex2Dlod(SampFields, mul(float4(posQueue.x+p10.x ,posQueue.y+p10.y,0,0), FieldsTransform)+ 0.5).b;
           d_1n +=  p11  *tex2Dlod(SampFields, mul(float4(posQueue.x+p11.x ,posQueue.y+p11.y,0,0), FieldsTransform)+ 0.5).b;
           d_1n +=  p12  *tex2Dlod(SampFields, mul(float4(posQueue.x+p12.x ,posQueue.y+p12.y,0,0), FieldsTransform)+ 0.5).b;

Or is it more performant to write the values directly and save the calculations?
greetings from Vienna Robi

elliotwoods 01/08/2012 - 17:17

@robi - the compiler unwraps the loops, and any calculations based on constants will be pre-computed.

sanch 09/08/2012 - 17:21

@ robi , i tried to do it in a loop when i started , but i couldn't manage to have the shader compiling , so i did the loop by hand, feel free to upload your version.

princemio 17/07/2014 - 14:17

Really NICE!!! Dx11 is getting more and more interesting stuff to play with. I might have one suggestion. The map which is used to define boundaries is the same map which holds the particles. Hence the particle interaction with each other is the same as the particles interaction with the boundaries. Im not sure but do you think that a seperation of two different maps (particles and Boundaries) would make more sense. Think of oil or gas that holds together but pushes from the wall. Please correct me if im wrong.

Anyway thank you very much!!!

mio

Noir 17/07/2014 - 16:23

thanks sanch

anonymous user login

Shoutbox

~8d ago

joreg: Postponed: Next vvvv beginner course starting April 29: https://thenodeinstitute.org/courses/vvvv-beginner-class-summer-2024/

~1mth ago

~1mth ago

joreg: The Winter Season of vvvv workshops is now over but all recordings are still available for purchase: https://thenodeinstitute.org/ws23-vvvv-intermediates/

~2mth ago

schlonzo: Love the new drag and drop functionality for links in latest previews!

~2mth ago

joreg: Workshop on 29 02: Create Sequencers and Precise Clock Based Tools. Signup here: https://thenodeinstitute.org/courses/ws23-vvvv-08-create-sequencers-and-precise-clock-based-tools-in-vvvv-gamma/