Hi everyone
I am trying to create background texture using canvas for orthographic camera. But if I use GTAO pass- black plane appears in the middle of scene.
To show this I’ve created texture(using canvas) in this GTAO file.
Code I have added to 101 line:
const createGradientTexture = () => {
const canvas = document.createElement('canvas');
canvas.width = 16;
canvas.height = 256;
const context = canvas.getContext('2d');
const gradient = context.createLinearGradient(0, 0, 0, 256);
gradient.addColorStop(0, '#3aa4d9');
gradient.addColorStop(1, '#64ec3f');
context.fillStyle = gradient;
context.fillRect(0, 0, canvas.width, canvas.height);
return new THREE.CanvasTexture(canvas);
};
const gradientTexture = createGradientTexture();
scene.background = gradientTexture;
and I scaled down model:
model.scale.set( 0.001, 0.001, 0.001 );
Version of three: “^0.162.0”
I would appreciate any help you can give me
Here is result with black plane: