• Home
  • Documentation
  • Forum
  • Blog
  • Users
    • Map
    • Userlist
    • Businesses
    • Userpages
    • Connections
  • Contributions
    • All
    • Store
  • Downloads
    • vvvv beta
    • vvvv beta previews
  • Store
Show / Hide Table of Contents

Particle water

Author: sanch
Date: 29 May, 2012
Category: effect
Credits:

dottore sanch

Download

64bit

1-ParticleSelfCollide.zip
16 Jul, 2014 - 14:24
dx11 version
0-ParticlesGPU_2d_Dynamic_FieldTexture.zip
29 May, 2012 - 00:02

Description

Particle water effect could be improve probably.

Comments

Comments are no longer accepted.
Please create a new topic in the vvvv beta forum to discuss this contribution.
androsyn
29 May, 2012 - 01:49

great! having lot of fun with this patch ^^

Desaxismundi
29 May, 2012 - 07:05

cool one!

sebl
29 May, 2012 - 11:51

really awesome

lasal
29 May, 2012 - 18:17

Grande Sanch!

m4d
30 May, 2012 - 00:19

neat stuff :)

sanch
30 May, 2012 - 01: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 May, 2012 - 08:16

amazing stuff!

io
02 Jun, 2012 - 13:41

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

title

robi_h
01 Aug, 2012 - 14: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](1.0f/samples)*i*2*PI)*0.5*radius;
		pNew.y = sin([1.0f/samples)*i*2*PI](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 Aug, 2012 - 15:17

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

sanch
09 Aug, 2012 - 15: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 Jul, 2014 - 12: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 Jul, 2014 - 14:23

thanks sanch

  • Improve this Doc

© 2020 by vvvv group. Imprint | Privacy Policy.
Thanks to DocFX for building this website. Analytics by Plausible.

Back to top