three.js icon indicating copy to clipboard operation
three.js copied to clipboard

WebGL particles size

Open Omiod opened this issue 15 years ago • 5 comments

Hi, I've seen that you've added the particles to the WebGL renderer, so I wanted to improve Fastkat (one of your featured projects, that I made with the canvas renderer) adding more particles and flashy effects. But have noticed that the WebGL particles do not scale with the distance, as in all your demos they are always at the same size, no matter where the camera is.

Is there just an option to be enabled, or simply the canvas and webGl particles behaves differently?

Omiod avatar Apr 15 '11 20:04 Omiod

The particles do not scale on this one? http://mrdoob.github.com/three.js/examples/webgl_particles_billboards_colors.html

mrdoob avatar Apr 15 '11 20:04 mrdoob

Well, that's exactly the demo I was testing, and I added this: "camera.position.z = camera.position.z -1;" in the render loop to move through. The distant particles do shrink, but when approaching they never get bigger than the original "ball" texture.

I understand that enlarging too much the low resolution texture would be ugly, but I wonder if there are other reasons.

Omiod avatar Apr 15 '11 20:04 Omiod

It's a limitation of ANGLE. You're using Windows, right?

We need to change these particles to use quads internally some day, that'll fix the problem. You can use Sprite for now. Or you can just create Planes.

mrdoob avatar Apr 15 '11 21:04 mrdoob

Yes, XP, so I had issues with oudated/blacklisted drivers too ... I'll take a look at sprites then. Thanks.

Omiod avatar Apr 15 '11 23:04 Omiod

Sprites don't support fog yet though. So probably Plane is your only option :/

mrdoob avatar Apr 15 '11 23:04 mrdoob