There is indeed a bug with bump + OIT that comes from shader derivatives (dfdx and dfdy) being equal to 0, probably because some code paths from OIT donāt reach the derivative calculation. Iām still looking for a proper way to fix it, as safeguarding dfdx values has proven to be breaking bump.
In the meantime, I would advise to either disable bump or disable OIT, whichever is less important visually in your case
it seems to me that the normal error is fixed (checked version 5.13.3). Thank you very much @CraigFeldspar.
However there is still an error with the sorting, when hdr is to true for the rendering pipeline.
Thatās funny because I didnāt push any fix but the fact that it breaks now with hdr and not with normal pipeline will give me more info to investigate and hopefully find a definitive fix.
@CraigFeldspar I am sorry to tell you the normal error is still there. Just checked version 5.14.1.
In addition to that, it does not break with one or the other.
There is a sorting error, when hdr is set to true and black lines appear, when a normal map is used.
Yes it kinda confirms what I was thinking, the use of dFdx and dFdy to calculate tangents in the shader (when they are not in the model) breaks OIT and bump
spent another few hours debugging that, I still donāt have a fix but Iām closer to finding the real problem. Posting details here in case someone else wants to take a stab at it too :
Turns out the problematic lines are in the oitFragment.fx shader bit : we use texelFetch and gl_FragCoord to retrieve the previous depth/color. I didnāt notice the problem during the development because I always used constant alpha values for the whole mesh. In here, the opacity texture makes alpha values vary from pixel to pixel, and it turns out this texelFetch sometimes doesnāt exactly sample the right depth/alpha (dunno why though). If you replace these fetches by a constant value, the problem is gone. Could also be a side effect somewhere else in the code, who knowsā¦
Iāll pick back this issue later on, but for now I feel like I spent too much time on it, Iāll let my eyes rest a bit
I am very sorry to tell you that I still have the problem.
However, what I noticed is that it works when I use the integrated graphics card on my laptop, but not with the didcated Nvidia card.
I tried BabylonJS version 5.26.1.
Does this already include your fix?
The graphics card that is not working is a NVIDIA RTX 3080 Latop GPU with driver version 497.09.
It seems to me that this might be a driver issue?
Is the chromium bug tracker the right place to report it?
Isnāt it more an Nvidia issue?
Nonetheless, we could help ourselves by precomputing the tangents and skipping the whole dfdx/dfdy calculation in the shader. By doing this, the black lines disappear.
But now we have a new problem: When an object is viewed from a distance, it becomes noisy. Maybe this is due to missing trilinear filtering?
The noise is only visible, when āscene.useOrderIndependentTransparencyā is set to true.