IdeaSpaceVR / aframe-particle-system-component

Particle systems for A-Frame.
https://ideaspacevr.github.io/aframe-particle-system-component/
MIT License
230 stars 68 forks source link

Particles scale incorrectly with distance from camera #36

Open interfect opened 6 years ago

interfect commented 6 years ago

I'm rendering a bunch of spheres, with a particle system on each. I want to eventually achieve a glow effect, but right now I'm just using the default star-shape texture.

Here's a sphere from far away:

screen shot 2018-04-25 at 9 13 37 pm

And here it is close-up (ignore the other, orange spheres behind it):

screen shot 2018-04-25 at 9 14 59 pm

When I get the camera close to the sphere, the star shape of the particle is much smaller, compared to the size of the sphere, than it is when the camera is far from the sphere. This should not happen (or at least is not documented) and suggests that there is a bug in the particle shader.

interfect commented 6 years ago

Another bug that you can see in the second shot is that particles do not render in proper Z order. Some of the particles from the closer, white system are being drawn over by particles from other systems behind it. Having the spheres sort of mitigates this (as the particles interact with the spheres correctly according to Z order).

weddingdj commented 6 years ago

The A-Frame component is just wrapping this particle engine: https://github.com/squarefeet/ShaderParticleEngine - I guess your issue is rather related to the engine itself than to the component.