xeokit-sdk icon indicating copy to clipboard operation
xeokit-sdk copied to clipboard

The model is more pixelated when logarithmicDepthBuffer is enabled

Open Amoki opened this issue 3 years ago • 6 comments

Describe the bug When using logarithmicDepthBufferEnabled: true, the model is more pixelated.

With logarithmicDepthBufferEnabled: false: Capture d’écran de 2021-05-11 16-36-39 With logarithmicDepthBufferEnabled: true: Capture d’écran de 2021-05-11 16-36-59

Depending on camera position, there is also some glitches when logarithmicDepthBuffer is enabled: Capture d’écran de 2021-05-11 16-47-27(1)

Expected behavior Same rendering for both

Desktop (please complete the following information): Tested on Ubuntu, Firefox and Chrome with and XKT v6 model model.zip

Amoki avatar May 11 '21 14:05 Amoki

Hi @xeolabs, This really decreases the rendering quality, feels like the render is done with an 800x600 resolution. Do you have any news?

Amoki avatar May 24 '21 11:05 Amoki

I haven't got to this yet, no clues why. The only thing log depth buffer changes is the depth values written, so I have no clue yet how this would affect output resolution. As a workaround, I would leave log depth buffer disabled for now. It seems to have little benefit for BIM models so far, as far as I can see.

xeolabs avatar May 24 '21 12:05 xeolabs

Unfortunately, we open building models and cityGML models without differentiation. As the log depth buffer setting is static at loading, we can't set it to true if the user loads an IFC model first then loads a cityGML model. If we reload the viewer when a new model needing log depth buffer is loaded, the user loses the current object states.

Disabling it is a real regression in our case :/

Amoki avatar May 24 '21 13:05 Amoki

As snap to vertex needs logarithmicDepthBuffer, this issue is even more relevant.

Render without logarithmicDepthBuffer: Screenshot from 2023-09-26 14-02-32

Render with logarithmicDepthBuffer: Screenshot from 2023-09-26 14-02-11

Amoki avatar Sep 26 '23 12:09 Amoki

Actually we don't need to enable log depth buf for snap-to-vertex any more.

I made the snapping shaders internally use a log depth buffer, regardless of whether we enable one for normal rendering or not, which fixes the snapping occlusion problem

  • see commit https://github.com/xeokit/xeokit-sdk/commit/0b7f2c77eb757d4b06607c84c5807019d89ae8ff
  • discussion: https://github.com/xeokit/xeokit-sdk/pull/1062#issuecomment-1714362091

So, snapping should work OK with log depth buffer disabled.

xeolabs avatar Sep 26 '23 14:09 xeolabs

Putting this on the 2.4 milestone in case there is something we can do for this, all the same

xeolabs avatar Sep 26 '23 14:09 xeolabs