shaders = {
const vs = `#version 300 es
in vec3 position; // Attribute
in vec3 normal; // Attribute
uniform float asp; // Windo aspect ratio: hindow.width/window.height
out vec3 fragNormal; // Variable whose value will be associated with the gl_position.
void main () {
gl_Position = vec4(position.x/asp, position.yz, 1);
// Note: gl_Position is a A predefined vec4 variable. It must be set with a vec4 value.
fragNormal = normalize(normal);
}`;
const fs = `#version 300 es
precision mediump float;
in vec3 fragNormal;
out vec4 outColor; // User-defined output variable for
void main () {
vec3 N = normalize(fragNormal);
//vec3 color = (N+1.0)/2.0;
outColor = vec4(abs(N), 1);
}`;
return [vs, fs];
}