My Code IS Getting These Errors. While I Have Downloaded Many Modules Which Were Related But Still Getting This Errors
THREE.WebGLProgram: Shader Error 0 - VALIDATE_STATUS false
Program Info Log: Vertex shader is not compiled. ERROR: 0:66: 'vUv' : undeclared identifier ERROR: 0:66: 'assign' : l-value required (can't modify a const) ERROR: 0:66: '=' : dimension mismatch ERROR: 0:66: 'assign' : cannot convert from 'in highp 2-component vector of float' to 'const highp float'
My Code In Which errors Are Occurring
const WaveShaderMaterial = shaderMaterial(
// Uniform
{
uTime: 0,
uColor: new THREE.Color(0.0, 0.0, 0.0),
uTexture: new THREE.Texture(),
},
// Vertex Shader
glsl`
uniform float time;
varying vec2 uVu;
varying vec3 vPosition;
uniform vec3 pixels;
varying vec3 vNormal;
varying vec3 eyeVector;
float PI = 3.141592653589793238;
void main() {
vUv = uv;
vNormal = normalize(normalMatrix*normal);
vec3 newPosition = position;
vec4 worldPosition = modelMatrix * vec4( newPosition, 1.0 );
eyeVector = normalize(worldPosition.xyz - cameraPosition);
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
}
`,
// Fragment Shader
glsl`
uniform float time;
uniform float progress;
uniform sampler2d Dream;
uniform vec4 resolution;
varying vec2 uVu;
varying vec3 vNormal;
varying vec3 eyeVector;
float PI = 3.141592653589793238;
void main() {
vec2 uv = vec2(0.5,-0.5)*gl_Fragcolor.xy/vec2(1000.);
vec3 x = dFdx(vNormal);
vec3 Y =dFdy(vNormal);
vec3 normal = normalize(cross(X,Y));
vec3 refracted = refract(eyeVector, normal, 1./3.);
uv += refracted.xy;
float diffuse = dot(normal, vec3(1.));
vec4 t = texture2D(Dream,vUv);
gl_Fragcolor = t;
}
`
);
extend({ WaveShaderMaterial });