How three.js uses the gradient color for the background

It's simple to do this with a shader var myGradient = new THREE.Mesh( new THREE.PlaneBufferGeometry(2,2,1,1), new THREE.ShaderMaterial({ uniforms: { uColorA: { value: new THREE.Color }, uColorB: { value: new THREE.Color } }, vertexShader: require('./gradient.vert'), fragmentShader: require('./gradient.frag') }) ) Now i used to render this as such: myGradient.material.depthWrite = false myGradient.renderOrder = -99999 Which would cause this mesh to render first, and then everything over it.

Actions
Flag