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 :)
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…
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…
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…
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