Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

depthWrite not working #3212

Closed
Memolestas opened this issue Mar 20, 2013 · 5 comments
Closed

depthWrite not working #3212

Memolestas opened this issue Mar 20, 2013 · 5 comments

Comments

@Memolestas
Copy link

I have two planegeometries each with a meshbasicmaterial with depthWrite= false and renderDepth=0 but the two objects still render like usual, I want them to be on the background

@WestLangley
Copy link
Collaborator

As stated in the guidelines, help requests should be made in stackoverflow. This board is for bugs and feature requests.

@Memolestas
Copy link
Author

this is a bug

@mrdoob
Copy link
Owner

mrdoob commented Mar 20, 2013

If it's a bug you should still follow the guidelines and provide the details we ask for. A test case on jsfiddle is a must.

@horsman
Copy link

horsman commented Mar 20, 2013

I've confirmed that setting depthWrite to true will have no effect if depthTest is false.
try flipping the depthTest value in material, below.

            maskedPlaneGeo = new THREE.PlaneGeometry( 10,10, 1, 1 );
            planeMat = new THREE.MeshBasicMaterial();
            planeMat.depthTest = true;
            planeMat.depthWrite = false;
            planeMat.transparent = true;
            planeMesh = new THREE.Mesh( maskedPlaneGeo, planeMat );
            planeMesh.rotation.setZ(3.14159 / 4);
            planeMesh.position.setZ(-10.1);
            planeMesh.renderDepth = -2;
            // Mask
            maskGeometry = new THREE.PlaneGeometry( 14.14,10, 1, 1 );
            material = new THREE.ShaderMaterial(DepthMaskShader);
            material.transparent = true;
            material.depthTest = true;
            material.depthWrite = true;
            material.alphaTest = false;

            mesh = new THREE.Mesh( maskGeometry, material);
            mesh.position.setY(-5);
            mesh.position.setZ(-10);
            mesh.renderDepth = -1;
            scene.add( mesh );
            scene.add( planeMesh );

@mrdoob
Copy link
Owner

mrdoob commented Mar 21, 2013

jsfiddle please?

@mrdoob mrdoob closed this as completed May 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants