diff options
author | iurii <[email protected]> | 2024-09-07 21:56:06 +0200 |
---|---|---|
committer | iurii <[email protected]> | 2024-09-07 21:56:06 +0200 |
commit | e5448ede7f1e3b13dc2041819bdc75effb08708c (patch) | |
tree | 6ed1d4d8fbe6ea5bc95a0b8bd9c296bd17a15262 /src | |
parent | 56393dd58592d129708a737db31484d7bf25e5be (diff) | |
download | funhalla-e5448ede7f1e3b13dc2041819bdc75effb08708c.tar.gz |
fake spotlight
Diffstat (limited to '')
-rw-r--r-- | src/main.odin | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main.odin b/src/main.odin index a55ce7e..997aeb2 100644 --- a/src/main.odin +++ b/src/main.odin @@ -196,7 +196,12 @@ main :: proc() { shader_set_vec3(lighting_shader, cstring("light.diffuse"), &light_diffuse) shader_set_vec3(lighting_shader, cstring("light.specular"), &light_specular) - shader_set_vec3(lighting_shader, cstring("light.position"), &light_pos) + shader_set_vec3(lighting_shader, cstring("light.position"), &camera.position) + shader_set_vec3(lighting_shader, cstring("light.direction"), &camera.front) + + cutoff_angle : f32 = math.cos(linalg.to_radians(f32(12.5))) + shader_set_f32(lighting_shader, "light.cutOff", cutoff_angle) + shader_set_vec3(lighting_shader, cstring("view_position"), &camera.position) shader_set_f32(lighting_shader, "light.constant", 1.0) |