You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I set depthTest = true and depthWrite = false, depth testing still works as expected.
When I use WebGLRenderer or WebGPURenderer (without enabling logarithmic depth), everything works fine. However, the issue arises after I enable logarithmic depth.
The image below is the expected result.
wrong depth
The green sphere in the foreground should be occluded by the red sphere below it.
This issue has affected many visual effects in my scene, and I sincerely hope it can be resolved.
Maybe it's because you're using a MeshBasicMaterial instead of a MeshBasicNodeMaterial. In addition, the depthNode is not served. I don't know how much automatism can be expected. I have an example here that works very well. You can see the different depths through the cubes.
Both MeshBasicNodeMaterial and MeshBasicMaterial have the same depth issue.
I tried your example and found that enabling depth testing and disabling depth writing still results in the same issue I mentioned earlier. This issue becomes more pronounced when transparent is set to false.
I believe that depthTest, depthWrite, and similar settings should be part of the three.js's fundamental configuration. Users shouldn't need to perform additional operations; Requiring users to set a custom depthNode for all materials while also considering whether logarithmic depth is being used places an unnecessary burden on them. @sunag
Description
When I set
depthTest = true
anddepthWrite = false
, depth testing still works as expected.When I use WebGLRenderer or WebGPURenderer (without enabling logarithmic depth), everything works fine. However, the issue arises after I enable logarithmic depth.
The image below is the expected result.
wrong depth
The green sphere in the foreground should be occluded by the red sphere below it.
This issue has affected many visual effects in my scene, and I sincerely hope it can be resolved.
Reproduction steps
emoty
Code
// code goes here
Live example
jsfiddle example
Screenshots
No response
Version
171
Device
Desktop
Browser
Chrome
OS
MacOS
The text was updated successfully, but these errors were encountered: