Background color in WebGL

Can’t change background color in https://codepen.io/ksenia-k/pen/RwqrxBG

let renderer = new THREE.WebGLRenderer({
canvas: canvasEl,
alpha: true,
});

renderer.setClearColor( 0xffffff,1 );

sceneBasic.background = new THREE.Color(0xffffff);

sceneShader.background = new THREE.Color(0xffffff);

  • not work(

  • Does this answer your question? Changing three.js background to transparent or other color

    – 

  • Changing three.js background to transparent or other color – did not help

    – 

  • The shader is reading from a texture to set the background color, so you need to either set that texture or write a constant color instead.

    – 

Leave a Comment