Hello,

I’m new to GLSL and am trying to implement my own basic set of shaders, starting with Lambert shading. I’ve looked at a bunch of examples but am stuck.

My shader draws a shadow on a sphere based on a single light source. My problem is that the shadow doesn’t update as I move the OrbitControls camera around.

Vertex shader:

```
varying vec3 vViewPosition;
varying vec3 vNormal;
void main() {
vViewPosition = (modelViewMatrix * vec4(position, 1.0)).xyz;
vNormal = normalMatrix * normal;
vec4 worldPosition = (modelMatrix * vec4(position, 1.));
gl_Position = projectionMatrix * viewMatrix * vec4(worldPosition.xyz, 1.);
}
```

Fragment shader:

```
uniform vec3 lightPos;
varying vec3 vNormal;
varying vec3 vViewPosition;
void main() {
vec3 normal = normalize(vNormal);
vec3 lightDir = normalize(lightPos - vViewPosition);
float lambertian = max(dot(normal, lightDir), 0.0);
gl_FragColor = vec4(vec3(1.0) * lambertian, 1.0);
}
```

I think I must be missing something simple!