I understand you can set a CubeTexture
as the background of your scene, as seen in this example.
When doing so, under the hood, the WebGLRenderer creates a cube that renders the BackSide
of the faces:
boxMesh = new Mesh(
new BoxBufferGeometry( 1, 1, 1 ),
new ShaderMaterial( {
uniforms: ShaderLib.cube.uniforms,
vertexShader: ShaderLib.cube.vertexShader,
fragmentShader: ShaderLib.cube.fragmentShader,
side: BackSide,
depthTest: true,
depthWrite: false,
fog: false
} )
);
I saw that ShaderLib.cube.uniforms
contains the following values:
uniforms: {
tCube: { value: null },
tFlip: { value: - 1 },
opacity: { value: 1.0 }
},
The above code can be found here… which leads me to believe that there has to be a way to access the opacity uniform and modify it. Has anybody had any success playing with this opacity value? If so, how did you access it? I’ve tried trowling through
WebGLRenderer.background
WebGLRenderer.context
The only methods available to do anything to the background seem to be getters/setters for ClearColor and ClearAlpha. Is there any way, or do I just need to re-build my own background cube?