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

# Particle water

effect
Credits: dottore sanch

Particle water effect could be improve probably.

ParticleSelfCollide.zip
dx11 version

Older Revisions

ParticlesGPU_2d_Dynamic_FieldTexture.zip

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 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++){
d_1n +=  pNew  * tex2Dlod(SampFields, mul(float4(posQueue.x+pNew.x ,posQueue.y+pNew.y,0,0), FieldsTransform)+ 0.5).b;
}```

```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

# Shoutbox

~12d ago

~28d ago

mediadog: @ggml Yup, lots. Only used in 4.x, haven't tried in 5.x yet: https://www.unrealengine.com/marketplace/en-US/product/simple-udp-tcp-socket-client

~29d ago

ggml: someone has sent udp bytes to unreal ?

~2mth ago

micha_nismus: worked out, thank you very much ! :-)

~2mth ago

joreg: @micha_nismus does this help? https://youtu.be/xkrbT45BgOQ

~2mth ago

micha_nismus: thx joerg. Can anybody help me why i can't see any renderer in gamma? thx :-)

~2mth ago

joreg: @micha_nismus instead of discord, we're using matrix, see: chat

~2mth ago

micha_nismus: searching for a public discord server for vvvv

~2mth ago

joreg: Join us for the 20th #vvvv meetup on January 19th: https://thenodeinstitute.org/event/20-worldwide-vvvv-meetup/

~2mth ago

joreg: @schlonzo re "SDSL support" did you see the Shader wizard? or do you mean something different?