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

gman
  • 100,619
  • 31
  • 269
  • 393
ArUn
  • 1,317
  • 2
  • 23
  • 39
  • You might find [this explanation of the z-buffer/depth buffer resolution](http://stackoverflow.com/a/21106656/128511) 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. – gman Jan 06 '17 at 03:11

1 Answers1

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.

mtx
  • 1,196
  • 2
  • 17
  • 41