Particles in the center of particlesGPU when using custom particle source

Hello, I’m trying to have a kinect as a custom particle source using particlesGPU.
I got it working but it seems that whenever I use the particle source on the particlesGPU comp there is always a point in the center that is creating particles. As far as I could find it doesn’t really matter what is connected there is always that point.

I’ve applied wind force to it so it’s more visible. Can I somehow get rid of that point or is it a bug?

Build 2022.35230
Windows 11

I’m also experiencing the same issue, it spawing particles at the origin of the camera even with a black input

I’ve managed to create a temporary work around by adding this code to the glsl shader

// ################# Main Functions ##################//
void Read(int index)
{
	
	ivec2 texPos = Index2XY(index);
	vec4 position = imageLoad(mTDComputeOutputs[PARTICLE_POS], texPos);
	vec4 life = imageLoad(mTDComputeOutputs[PARTICLE_LIFE], texPos);
	vec4 velocity = imageLoad(mTDComputeOutputs[PARTICLE_VELOCITY], texPos);
	vec4 rotateToVector = imageLoad(mTDComputeOutputs[PARTICLE_ROTATEVECTOR], texPos);
	vec4 initColor = imageLoad(mTDComputeOutputs[PARTICLE_INIT_COLOR], texPos);
	vec4 size = imageLoad(mTDComputeOutputs[PARTICLE_SIZE], texPos);
	vec4 rotation = imageLoad(mTDComputeOutputs[PARTICLE_ROTATION], texPos);

  // fix particle spawning in origin point
  if (position.x + position.y == 0) {
    position.x = 1. / 0.;
    position.y = 1. / 0.;
  }

	// build particle struct
	gParticle.index = index;
	gParticle.id = int(size.w);
	gParticle.lifetime = life.x;
	gParticle.maxLife = life.y;
	gParticle.state = int(life.z);
	gParticle.position = position.xyz;
	gParticle.velocity = velocity.xyz;
	gParticle.force = vec3(0.0);
	gParticle.speed = velocity.w;
	gParticle.rotateToVector = rotateToVector.xyz;
	gParticle.size = size.x;
	gParticle.sizeType = size.z;
	gParticle.initColor = initColor;
	gParticle.rotation = rotation.xyz;

}
1 Like

Hi @lex_van_ham and @prismcoders,

the source looks at the alpha channel to decide if the position should be used or not. As the texture comes in with alpha 1 on all pixels, the pixels at 0,0,0 will be created as well as this is a completely valid place for a source to produce particles from.

So what you would want to do is somehow make the alpha channel reflect which pixels should be used for position and which wont.

cheers
Markus

Hi @snaut, I’m getting problems even if I pass a TOP with alpha it produces a triangular shape from the origin to the particle source

Hi @prismcoders,

could you send a file with the source TOP locked so I can have a look? Wondering if there is any Antialiasing in the TOP that might cause this. You could check by looking at the TOP in the “View as Points” viewer state

image

cheers
Markus