Texture formats for gpu particles

I’m having a play with making field textures for ParticlesGPU_2d_Dynamic_FieldTexture in gpu particles.

The texture format used is G32R32F where G is the signed x velocity and R is the signed y velocity.

This works as expected, but now I’m trying to simulate having two field textures (to attach to tracked kinect skeleton hands) by texturing two quads with the field texture, performing a render pass then sending that dx texture into gpu particles.

This works for the +x and +y direction, but not -x and -y. I’ve set the dx9texture to G32R32F but it seems the -ve values are being lost. Is this expected behaviour? If so is there another way to achieve what I’m trying to do?

Also, if anyone has suggestions for interesting ways to use the kinect with gpu particles I’d love to hear about em :)

you can create multiple texture inputs for a shader and add the values before they are used in the shader directly…

Ah yep, that works.

It would be way more flexible to able to ‘composite’ the field texture beforehand with a render pass though.

Is it not possible to render a 64bit float texture?

Hi Mrboni!
I’m struggling with the same thing from 2 week. But no shading skills for me, so… I can point you to those threads:



I remember also some screenshot (I think from Lasal) that clearly made some kind of interaction with particles (maybe with ?contour?)

Also CIANT Particle can interact with particles and kinect, but testing with b27.1 I have a point in the center of the texture that emit particle and I don’t know why (Maybe the texture format?..)

I’ll bookmark this thread to stay tuned on this topic and I’ll post a cleaned up version of Dottore Particle GPU 2d Field soon…


Hi again Mrboni,
Hi all!

Here’s is the patch (and subPatches) for live texture field interaction plus more option I worked on.

Open (_ROOT)

Let me know if you can improve something.

A big deal for me would be to convert the Kinect RAW User Texture to a Reset Texture for particle emission, but I cannot figure how convert a 2d texture (16Bit) in a monodimensional texture cycle…

I know in CIANT particle this could be done, but in B27.1 with new kinect driver doesn’t work quite well. I think is something related to Texture Format.

Texture Format and GPU Particle expert needed!
Someone shade this topic and this particle…

Bye Mrboni
Thanks Guys

Tell me if i miss some subpatch or effects (for example the modified ScaleColor from Elliot Woods sometimes doesnt connect well) (116.7 kB)

I’ve edited the shader to take 0.5 from the texture inputs which means you can just use a normal renderer with basic shapes in with a mid grey being 0, black being -0.5 white 0.5, you loose resolution but can easily used tracking points to move the fields around…
Can’t post the shaders at the moment tho…

@Cat - Yep that works, though when particles leave the defined starting area they can glitch out.

I added the line -
fieldsAdd.rg += -.5;

after the line -
float2 fieldsAdd = tex2D(SampFields, mul(float4(posQueue.rg,0,1), FieldsTransform)/2 + 0.5).rg;

Any idea why I’d be getting the glitch?

@Robe - Attached is a version of the patch/effect where 0.5 red and 0.5 green are ‘zero’, so you can composite the field texture in a render pass. Note the bug in it if particles move too far out.

It’s the ParticlesGPU_2d_Dynamic_FieldTexture ROOT [rendered field tex](rendered field tex).v4p file

Thanks for posting your patch. I’m gonna have a look at it now…

(note that although the square fields are rotating in my example, the field direction does not change as the colour of the pixels remains the same…

ParticlesGPU_2d_Dynamic_FieldTexture [rendered field tex].zip (72.8 kB)

hi mrboni
interesting, but zip probably missing Scalecolor.fx

@dimix - scalecolor.fx isn’t in the patch

attached is an example of hand tracking interaction to create the field, and also using a second texture input as an easy way to add further distortions.

If you have a kinect or other way of tracking hands etc, plug it in where commented.

_ROOT_particles hand interaction.v4p is the one you want

Sorry for the messy patch!

particles hand interaction.zip (42.3 kB)