molstar / molstar

A comprehensive macromolecular library

Home Page:https://molstar.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bumpiness not working on ball and stick representation

giagitom opened this issue · comments

It does not work using both meshes or impostors

That is intended, the default bumpFrequency is set to zero for some representations where is does not look good. See src\mol-repr\structure\representation\ball-and-stick.ts. If you change the bumpFrequency you can still get bumpiness.

Hmm.. It seems that also varying bump frequency does not produce any effect on the representation. Maybe it is disabled somewhere else?

image

Oh.. sorry It was my fault. I didn't increase bumpiness on material. It is working fine.

Maybe just reconsider enable it by default since I hardly see any graphic artifacts or issues.

image

The only issue I can see is this in the contact between cylinders.. but it is super small
image

I find the artifact quite strong without specular highlights

image

If you can fix the artifact, I am happy to reconsider

@arose I have found an other related issue with bumpiness on impostor spheres and cylinders that is most visible when xRayShaded is on. Here is a test state to reproduce the issue test.molj.txt

image

The issue seems to be due to this piece of code inside perturbNormal

float det = dot(sigmaS, r1);

Handling edge cases in which det == 0 like this if (det == 0.0) return vec3(normal); seems to fix the problem and also reduces the effect of the before mentioned artifact (that is still present though).

I suspect there is an other similar edge case breaking the perturbed normal.

thanks, applied the fix in fda3481