Closed AndyGura closed 4 months ago
To clarify, the artifacts occur when zooming out.
If I set preserveDrawingBuffer: false
, the artifacts disappear for me.
Alternatively, call renderer.clear()
in the render loop, and the artifacts disappear.
Confirmed with git bisect
, the change in behavior was introduced in #28118.
As a quick workaround, remove preserveDrawingBuffer: true
from your scene. You don't need it anyway and it is also slower to keep in set to true
. Besides, WebGLRenderer
has no background
parameter. outputColorSpace
is already THREE.SRGBColorSpace
so there is no need to set it explicitely.
More simplified test case: https://jsfiddle.net/uwom15j7/1/
The expected behavior would be white trails of the cube. However, you see flickering all over the mesh.
This issue also happens with r163
: https://jsfiddle.net/yjxsed1f/
Edit: Even with r120
.
I suspect this is related how the (mesh-based) backgrounds are implemented. Looks like a depth related issue since what you see is essentially z fighting, imo.
@AndyGura Why do you use preserveDrawingBuffer: true
in your scene? Is there a special reason we currently overlook?
@Mugen87 and @WestLangley thanks for advise, setting preserveDrawingBuffer
to false indeed solves the problem in my example. I do not remember why exactly it was set to true in my project, this example is oversimplified squeeze from project with big codebase.
Regarding @Mugen87 example, although the problem looks like mine, it can be reproduced with r163. But my original problem does not appear in r163 and appears in r164, so it looks like regression? Or you mean that it was "hidden" somehow up until r164?
Or you mean that it was "hidden" somehow up until r164?
Yes. I suspect the same root cause but it was overshadowed up to r164
. I believe if the simplified fiddle would work, the original codepen would work, too.
I have eventually found the issue. It is indeed a regression!
Thanks for reporting the issue.
Description
After upgrading three.js from
0.163.0
to0.164.0
or0.164.1
one particularGLB
model from my library breaks the renderer when camera looks at it, it leaves the "trail" on the screen, where only the background image visible. I'm not sure how to describe it in a more informative way TBH, see the screenshot and attached codepenReproduction steps
three@0.163.0
withthree@0.164.1
in HTMLOR
Code
Live example
CodePen
Screenshots
0.163.0
0.164.0(1)
Version
r164
Device
Desktop
Browser
Chrome
OS
Linux