I need image plane which is load material with shaderMaterial.
{
const planeGeometry = new THREE.PlaneGeometry(40, 40);
const planetexture = await LoadTexture(backgroundSrc);
const planeMaterial = new THREE.RawShaderMaterial({
vertexShader: `
void main() {
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
}
`,
fragmentShader: `
void main() {
gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
}
`,
uniforms: {
texture: { type: 't', value: planetexture },
},
side: THREE.DoubleSide,
transparent: true,
});
const planeMesh = new THREE.Mesh(planeGeometry, planeMaterial);
scene.add(planeMesh);
}
This is current code base
But in three 0.127.0 version, it occure errors.