1

On rendering the 3d model in a specific zoom the model is rendered correctly , but when the model is moved far way from the camera, the the part of the model behind it is rendered

Sets the renderer properties as, Renderer.context.disable(Renderer.context.DEPTH_TEST); Renderer.autoClearDepth = true; Renderer.autoClearStencil = true; Renderer.sortObjects = true; Renderer.shadowMapCullFace = THREE.CullFaceBack; Renderer.shadowMap.enabled = true; Renderer.shadowMap.type = THREE.PCFSoftShadowMap; Renderer.gammaInput = true; Renderer.gammaOutput = true;

on increasing the z value of the camera it is rendered properly as, enter image description here

but on decreasing the z value of camera , the blue textured 3d models comes over the white one,

enter image description here

1
  • You might find this explanation of the z-buffer/depth buffer resolution helpful. The short versionis like mfx says set your camera.near and camera.far to reasonable values. near should be as far away from the camera as you can make it and not clip whatever your displaying, far should be as close to the camera as possible and not clip your furthest object. Commented Jan 6, 2017 at 3:11

1 Answer 1

1

From what I understood from your question you have error when rendering object while changing camera z dimension.

You can try following to fix :

  • make sure your camera object has near and far values set to contain the object z position, something like:

    camera.near = 0.01; // minimum z

    camera.far = 10000; // maximum z

  • play with your object material properties: depthTest and depthWrite.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.