» 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 | 1618 downloads
dx11 version
Show 1 older revisions

Older Revisions

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

androsyn 29/05/2012 - 02:49

great! having lot of fun with this patch ^^

Desaxismundi 29/05/2012 - 08:05

cool one!

sebl 29/05/2012 - 12:51

really awesome

lasal 29/05/2012 - 19:17

Grande Sanch!

m4d 30/05/2012 - 01:19

neat stuff :)

sanch 30/05/2012 - 02: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 - 09:16

amazing stuff!

io 02/06/2012 - 14: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 - 15: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 - 16:17

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

sanch 09/08/2012 - 16: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 - 13: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 - 15:23

thanks sanch

anonymous user login

Shoutbox

~7d ago

andresc4: gamma+stride+fuse+standaloneapp+soputoutput+oscinput = lovvvvvveeeeeee!!!!

~9d ago

joreg: @pechart thanks for the flowers!

~9d ago

pechart: Just a big shoutout to the whole vvvv devteam and the friendly community! It's fantastic to export patches to standalone apps. THX!

~18d ago

daviddenker: We are looking asap for 3x Azure Kinect to rent or buy. Any kind of help appreciated! :-)

~21d ago

mediadog: Hmmm md.ecosystem link on staff pics page is not found

~23d ago

schlonzo: physics constraints and forces plz?

~25d ago

karistouf: thank you @gml but im thinking about and old version of vvvvv. There was a redraw with HSL of each pixels

~25d ago

schlonzo: no more previews? is there a 4.0 stable?

~27d ago

sunep: Live now. I perform live AV with Thomas Li after kiloton who is performing now. https://youtu.be/IG5oC6JvMeM

~27d ago

ggml: @karistouf ColorAndDepth help file