Just made the light the location of the camera, gives nice vibes
This commit is contained in:
parent
dfd0c57c59
commit
6c317c8ac3
@ -19,10 +19,10 @@ layout (set = 0, binding = 0) uniform Matrices {
|
||||
layout (set = 0, binding = 1) uniform sampler2D heightmap;
|
||||
|
||||
void main() {
|
||||
vec3 light_pos = vec3(10.0*cos(time), 10.0, 0.0);
|
||||
vec3 L = normalize(light_pos-pos);
|
||||
float r = length(light_pos-pos);
|
||||
//vec3 light_pos = vec3(10.0*cos(time), 10.0, 0.0);
|
||||
vec3 L = normalize(cam_pos-pos);
|
||||
float r = length(cam_pos-pos);
|
||||
float t = clamp(dot(L, norm), 0.0, 1.0) * 20.0/(r*r);
|
||||
|
||||
FragColor = vec4(t, t/2.0, t*2.0, 1.0);
|
||||
FragColor = vec4(t*norm, 1.0);
|
||||
}
|
||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user