WebGLRenderer: background is not set to transparent on 0.137.0 version
See original GitHub issueDescribe the bug
We upgrades the threejs version recently from 0.131.3
to 0.137.0
https://github.com/tensorflow/tensorboard/commit/420916a6e4c80740432f1e2bd0c83d6dd145da10. It breaks our repo by not setting the background to black. (see screenshots before)
After debugging we found the cause is from the background is not set to transparent by “alpha: true”. (which means, we can fix our issue by adding renderer.setClearColor(0x000000, 0);
)
Is there any changes from the version that makes this stop working?
To Reproduce You can reproduce the issue by clone our repo. Checkout to the upgrade comment and run TensorBoard (https://github.com/tensorflow/tensorboard). However it requires some demo data to run the card. Let me know how I can assist.
Code code point
//ts
this.renderer = new THREE.WebGLRenderer({
canvas: canvas as HTMLCanvasElement,
context: canvas.getContext('webgl2', {
antialias: true,
precision: 'highp',
alpha: true,
} as WebGLContextAttributes) as WebGLRenderingContext,
});
Screenshots before (0.131.3)
after (0.137.0)
Platform:
- Device: Desktop
- OS: MacOS
- Browser: Chrome
- Three.js version: 0.131.3 (works) 0.137.0 (breaks)
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (1 by maintainers)
Top GitHub Comments
Correct. I recommend the first one though. Creating a rendering context manually should only be done if there is a compelling reason.
Thanks for the reply! Moving the params out of context fixes the issue.