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

Particles are rendering behind my scene elements

Open NeoHoffa opened this issue 5 years ago • 6 comments

I added the snow example to my scene. It looks great! Although particles are rendering behind all of my 3D objects. Any thoughts?

Thanks!

NeoHoffa avatar Jan 25 '21 04:01 NeoHoffa

Oh I think you can take a look at this demo https://drawcall.github.io/three.proton/engine/example/spriterender-snow.html

drawcall avatar Jan 25 '21 04:01 drawcall

Right, that is the example I implemented in my project. It works fine except for the particles rendering behind everything.

When I implement the following code, var screenZone = new Proton.ScreenZone(this.camera, this.renderer, 20, "234"); emitter.addBehaviour(new Proton.CrossZone(screenZone, "dead"));

it throws this error... three.proton.min.js:10 Uncaught TypeError: Cannot read property 'domElement' of undefined at bd._dead (three.proton.min.js:10) at bd.crossing (three.proton.min.js:10) at J.applyBehaviour (three.proton.min.js:10) at i.update (three.proton.min.js:10) at P.integrate (three.proton.min.js:10) at P.update (three.proton.min.js:10) at b.update (three.proton.min.js:10) at HolidayStage.render (HolidayStage.js:304) at HolidayStage.animate (Stage.js:254) at animateStage (index.js:316)

So I comment out those two lines and the error goes away. Can you explain what the CrossZone does? Is that what allows it to render within my 3D scene? Or something else?

Thanks again! :)

NeoHoffa avatar Jan 25 '21 05:01 NeoHoffa

CrossZone here is to improve rendering performance, that is, the particles flying out of the scene die. You check whether the renderer is undefined

drawcall avatar Jan 25 '21 06:01 drawcall

Yes, sorry about that. The renderer reference was my bad. But the particles are still rendering behind my scene.

NeoHoffa avatar Jan 25 '21 16:01 NeoHoffa

I'm using THREE version 122. But I've tried other versions as well, so I don't believe it comes down to the version. The particles are still rendering behind all my objects. Any thoughts?

NeoHoffa avatar Jan 26 '21 16:01 NeoHoffa

@drawcall :(

NeoHoffa avatar Feb 03 '21 18:02 NeoHoffa