Open TimDeBauwReLu opened 6 months ago
What picture is incorrect ? do you have backface culling enabled on the incorrect picture ?
Backface culling is enabled on all pictures, the last picture (larger mandible with the full jawbone) is the incorrect one
I forgot to mention that this problem does not appear when using camera.setParallelProjection(true);
What's the difference between the 3rd picture and the last picture ? Only the mesh is different ?
The color of the bone is too dark, and you can see a big contrast between the bone and the teeth sockets (dark red vs bright red). It is supposed to be like this I believe:
Gotcha.
It would be great if you could attach that STL file to the issue. The shader code should be investigated...
Here are the files used to reproduce it:
You might want to check the magnitude of your normals (maybe it is different between the teeth triangles and the jaw triangles). Alternatively, you might also want to test without diffuse light coefficient, only ambient, and see if the problem is light related. Finally, you might want to consider the OrderIndependentTranslucentPass code...
@finetjul It looks like it has something to do with the diffuse light coefficient. When I put it to zero, it looks like this.
I guess that depending on the distance from the camera to the object, the intensity of the diffuse component changes? Do you have an idea where to investigate this issue?
And this blackness does not happen if it is opaque? Do you have ambient lighting?
Yes, it is caused because I do not have ambient lighting I believe. The blackness also occurs when the mesh is opaque
Bug description
I have a problem where the opacity of stl objects behaves inconsistently when backface culling is enabled. I have two meshes of a mandible, which both are rendered correctly when opacity=1 (see pictures below). I also checked that the backfaces of both meshes are on the inside.
When changing the opacity to be less than 1, you can see that the color of the bone is different on both objects (see pictures below). When zooming out far, both objects are again rendered correctly. Do you know what can cause this?
Steps to reproduce
Detailed Behavior
No response
Expected Behavior
Both objects are rendered correctly when opacity is less than 1 and backface culling is enabled
Environment