molstar / molstar

A comprehensive macromolecular library

Home Page:https://molstar.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Occlusion issue on edges

giagitom opened this issue · comments

Here a test state to reproduce test.molj.txt

image

Don't know why this happens, but the strength needs to be very high to to be apparent, so maybe a clamp is needed somewhere.

I'm seeing this also with default occlusion strength, it is less perceivable of course, but it seems always there when zooming in

image

Looks like it's come from getMappedDepth and the different resoltution, plus the multisample. If I do the following change: float sampleDepth = getDepth(offset.xy); // getMappedDepth(offset.xy, selfCoords); and disable the multisample effect the artifact disappear.

Hi @corredD,
Thanks, In my system I am able to resolve the issue just by disabling multisample. getMappedDepth seems to work fine to me.
I have found something else though, that remains even keeping multisample disabled. Here a test-state.molj.txt to reproduce

image

It seems to be related to the blur kernel. When disabled it disappears

It seems related to the near and far clipping plane values, which are used to linearize the depth value. In your example try changing the clipping value.

I see, it is visible in the front and back clipping planes.

image

And disabling far clipping plane it disappears on the back only
image

Thanks for investigating this. I am addressing this in #1134.