Particle vs. Plane Queue placement

I figure you guys might know this quickly. I have NPC characters placed in the enviornment. My NPC is just a flat plane it is place in the “setQueueBucket(Bucket.Transparent);”

			Quad b = null;
			
			b = new Quad(width, height, center);
	        setMesh(b);
			scale(scale);

When JME renders the Particles (ParticleMonkey), the NPC has an outline, it appears that the transparent part of the NPC Quad is not in the Transparent or maybe an order.

Do you guys have ideas to check inside the code.

You can see in the picture there is a clear path. The several snow particles you see in the the NPC quad area is in front of the NPC not behind the Quad.

Generally, a single particle emitter is one thing in the scene. So sorting it is done for the whole object. I don’t know much about particle monkey so I can’t say how it defines its bounds or how that will be sorted.

If both are in the transparent bucket and the particles are not blend mode AlphaAdd or do not have an alpha threshold set very high then you will have the reverse problem when they sort in front of the player… little gaps around the player.

For heavily pixelated sprites like this, you can probably solve all of your problems just by setting the alpha discard threshold on your character so that it doesn’t draw a giant transparent quad to the zbuffer and only draws the pixels that are not transparent.

3 Likes

Thanks. I can do that in the shader, it would be simple enough to through it out.

Thanks,

1 Like

Yeah, the stock JME shaders already do it… so it’s easy to copy, too.

2 Likes