I have a little question about Torn up artifacts when learning Cesium code and the blog articles.
Could you please help with my confusion? Thanks a lot in advance!
When reading article “Hybrid Multi-Frustum Logarithmic Depth Buffer”(Hybrid Multi-Frustum Logarithmic Depth Buffer – Cesium) and Professor Cozzi’s SIGGRAPH course slides(massiveworlds/Cozzi.pptx at master · pjcozzi/massiveworlds · GitHub), one detail information made me feel confused.
It’s the Page29 of Professor Cozzi’s slides. Here’s the capture of this page:
The thing I can hardly understand is that why artifacts can be torn where the near plane of one frustum meets the far plane of the closer frustum?
According to the source code “Source/Scene/View.js/function insertToBin()”, the artifacts, or the commands located near the frustum near/far plane would be put into both frustum and executed twice.
In this way, when execute the command in the further frustum, part of the command (nearer than the near plane) might be torn or clipped, and the context’s background color reveals. However, when the command is executed in the nearer frustum, the torn or clipped part in the previous frustum would not be torn or clipped in the current frustum. And the revealed background color would also be covered by the command in current frustum.
From my perspective, even if the the near plane of one frustum meets the far plane of the closer frustum, once a command’s bounding volume intersect the co-plane, the command would be executed in both frustums. How can artifacts or commands be torn or clipped under this circumstances? And why is it necessary to run “frustum.near = frustumCommands.near * scene.opaqueFrustumNearOffset” before execute commands in each frustum?