This is my code:
let material = this.material.clone();
let texturedots = new THREE.Texture(o.image);
texturedots.needsUpdate = true;
// image cover
let imageAspect = o.iHeight / o.iWidth;
let a1;
let a2;
if (o.height / o.width > imageAspect) {
a1 = (o.width / o.height) * imageAspect;
a2 = 1;
} else {
a1 = 1;
a2 = o.height / o.width / imageAspect;
}
texturedots.minFilter = THREE.LinearFilter;
material.uniforms.resolution.value.x = o.width;
material.uniforms.resolution.value.y = o.height;
material.uniforms.resolution.value.z = a1;
material.uniforms.resolution.value.w = a2;
material.uniforms.progress.value = 0;
material.uniforms.angle.value = 0.3;
material.uniforms.texture1.value = texturedots;
material.uniforms.texture1.value.needsUpdate = true;
let mesh = new THREE.Mesh(this.geometry, material);
mesh.scale.set(o.width, o.height, o.width / 2);
return mesh;
}
composerPass(){
this.composer = new EffectComposer(this.renderer);
this.renderPass = new RenderPass(this.scene, this.camera);
this.composer.addPass(this.renderPass);
//custom shader pass
var counter = 0.0;
var myEffect = {
uniforms: {
"tDiffuse": { value: null },
"distort": { value: 0 },
"resolution": { value: new THREE.Vector2(1.,window.innerHeight/window.innerWidth) },
"uMouse": { value: new THREE.Vector2(-10,-10) },
"uVelo": { value: 0 },
"uScale": { value: 0 },
"uType": { value: 0 },
"time": { value: 0 }
},
vertexShader: postvertex,
fragmentShader: postfragment
}
this.customPass = new ShaderPass(myEffect);
this.customPass.renderToScreen = true;
this.composer.addPass(this.customPass);
Getting this Error:
THREE.WebGLProgram: shader error: 0 35715 false gl.getProgramInfoLog Vertex shader is not compiled. THREE.WebGLShader: gl.getShaderInfoLog() vertex
ERROR: 0:59: '/' : syntax error
1: #version 300 es
2: #define attribute in
3: #define varying out
4: #define texture2D texture
5: precision highp float;
6: precision highp int;
7: #define HIGH_PRECISION
8: #define SHADER_NAME ShaderMaterial
9: #define VERTEX_TEXTURES
10: #define GAMMA_FACTOR 2
11: #define MAX_BONES 0
12: #define BONE_TEXTURE
13: uniform mat4 modelMatrix;
14: uniform mat4 modelViewMatrix;
15: uniform mat4 projectionMatrix;
16: uniform mat4 viewMatrix;
17: uniform mat3 normalMatrix;
18: uniform vec3 cameraPosition;
19: uniform bool isOrthographic;
20: #ifdef USE_INSTANCING
21: attribute mat4 instanceMatrix;
22: #endif
23: #ifdef USE_INSTANCING_COLOR
24: attribute vec3 instanceColor;
25: #endif
26: attribute vec3 position;
27: attribute vec3 normal;
28: attribute vec2 uv;
29: #ifdef USE_TANGENT
30: attribute vec4 tangent;
31: #endif
32: #if defined( USE_COLOR_ALPHA )
33: attribute vec4 color;
34: #elif defined( USE_COLOR )
35: attribute vec3 color;
36: #endif
37: #ifdef USE_MORPHTARGETS
38: attribute vec3 morphTarget0;
39: attribute vec3 morphTarget1;
40: attribute vec3 morphTarget2;
41: attribute vec3 morphTarget3;
42: #ifdef USE_MORPHNORMALS
43: attribute vec3 morphNormal0;
44: attribute vec3 morphNormal1;
45: attribute vec3 morphNormal2;
46: attribute vec3 morphNormal3;
47: #else
48: attribute vec3 morphTarget4;
49: attribute vec3 morphTarget5;
50: attribute vec3 morphTarget6;
51: attribute vec3 morphTarget7;
52: #endif
53: #endif
54: #ifdef USE_SKINNING
55: attribute vec4 skinIndex;
56: attribute vec4 skinWeight;
57: #endif
58:
59: /static/media/vertex.10140350.glsl THREE.WebGLShader: gl.getShaderInfoLog() fragment
ERROR: 0:88: '/' : syntax error