I use the shadow material to render the model. It is found that the rendered model is not very clear and the light-and-dark level is not high, how should this be set
vertexShader:
varying vec4 vPosition;
varying lowp vec3 vColor;
varying float vTransparent;
varying float vVisible;
varying vec3 pixelNormal;
void main() {
vUv = uv;
vPosition = modelViewMatrix * vec4( position, 1.0 );
vColor = color;
vTransparent = transparent;
pixelNormal = normal;
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}
fragmentShader:
varying vec4 vPosition;
varying lowp vec3 vColor;
varying float vTransparent;
varying vec3 pixelNormal;
void main(){
float shade = (
3.0 * pow ( abs ( pixelNormal.y ), 2.0 )
+ 2.0 * pow ( abs ( pixelNormal.z ), 2.0 )
+ 1.0 * pow ( abs ( pixelNormal.x ), 2.0 )
)/3.0;
gl_FragColor = vec4(vColor * shade, vTransparent);
}