This lighting shader should look very close or identical to the default normal map shader but with camera angle included in the calculation. The fragment shader is identical to the one in the demo. You'll need to pass the camera angle to the shader with set_shader_param()
.
uniform float cam_rot = 0.0;
mat2 rot_mat = mat2(vec2(cos(cam_rot), sin(cam_rot)), vec2(-sin(cam_rot), cos(cam_rot)));
vec3 light_dir = normalize(vec3(rot_mat * -LIGHT_VEC, LIGHT_HEIGHT));
float NdotL = max(0.0, dot(NORMAL, light_dir));
LIGHT = mix(COLOR * LIGHT_COLOR, COLOR * NdotL * LIGHT_COLOR, 1.0);