Open tingyus839 opened 1 week ago
The problem is that both the splats and the cube are transparent objects and rendering transparent objects that overlap can be difficult, since transparent objects don't write to the depth buffer (and if they did you'd still get incorrect results). You'd have the same problem rendering multiple transparent cubes if they overlap in 3D space. There isn't really a great solution to this problem in general (at least when splats are involved). For a scene with just transparent meshes, you could use something like depth peeling, but it's a complex thing to implement. Unfortunately for now, only opaque meshes are properly supported.
Hello, thanks for the great library! The library currently works well with other mesh geometry-based models in the scene. However, if the material of an object in the scene is semi-transparent (i.e. with
transparent=true
), the depth test result seems to be incorrect. Here is a video demonstrating the issue:The area marked by the green pen should not have the red tint since those 3DGS splats are in fact outside of the box. The problem seems to be related to the fact that
WebGLRenderer
of Three.js renders transparent objects separately and sort based on the distance to the camera. I've tried changingrenderOrder
ofGaussianSplats3D.DropInViewer
or the box object or changingdepthTest
property on the material of the box but still does not get correct result. Any help is appreciated.Minimum reproducible example modified from
demo/dropin.html
: