Skip to content

Tag: three.js

Render objects on top using renderDepth with Three.js

I’m trying to render objects on top of other objects. In the fiddle, get the green torus knots to render on top of the red boxes and floor. I’ve been trying mesh.renderDepth = 0, 1, 1000 and changes nothing. The material has been created like so: How can I achieve this using renderDepth? Am I miss…

How to Set WebGLRender background to transparent

I’m trying to put objects in front of CSS3DObjects with the THREE.NoBlending hack. But I only see the black plane without the CSS3DObject in the newest revisions (tried r65 and r66). A small example I made looks like this: index.html: moo.html: This is the result: Revision 58: http://i.imgur.com/tCszJ8X…

Transparent background with three.js

The code work, but I’m having a problem setting transparent background to the canvas with three.js. I use: But then the background gets black. How do I change it to be transparent? The code: Answer If you want a transparent background in three.js, you need pass in the alpha parameter to the WebGLRendere…

THREE.js Ray Intersect fails by adding div

My Three.js script runs fine when there is only one target div on the page (which holds renderer.domElement). As soon as I add another div with fixed height and width above the target div, ray.intersectObjects returns null. I doubt that the vector that I am creating for ray is causing the problem. Here is the…

Three.js WebGL texture shows up black on plane

So basically, I have a scene in WebGL with 2 planes. One of them has a transparent texture on it and it shows up fine. The other is supposed to have a high res, non-transparent texture loaded up on it and it is used as a background. I can’t figure out why the background plane isn’t working, since …

three.js transparent maps issue

I’m creating loads of particles (80.000 to be exact) and I have set a transparent map, though, not all particles are transparent. I’m using a transparent PNG image: (it’s barely visible but it’s there alright) as the material map, though it shows a black background as seen here: If you…