polyadvent

A game engine from scratch in C
git clone git://jb55.com/polyadvent
Log | Files | Refs | README

commit 033d790f9d3a2eb31c90608d7e64d8422aac0601
parent a9081c066f8af9aeaa6110a220d6a3bb1d900b41
Author: William Casarin <jb55@jb55.com>
Date:   Mon, 29 Oct 2018 02:44:28 -0700

tweak lightning

Diffstat:
Metc/shaders/terrain.glsl | 2+-
Metc/shaders/vertex-color.glsl | 2+-
Msrc/game.c | 2+-
Msrc/update.c | 2+-
4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/etc/shaders/terrain.glsl b/etc/shaders/terrain.glsl @@ -28,7 +28,7 @@ vec3 standard_light(vec3 color) { vec3 L = light_dir; vec3 N = normalize(trans_normal.xyz); - float costheta = clamp(dot(L,N), 0.1, 1.0); + float costheta = clamp(dot(L,N), 0.3, 1.0) * light_intensity; return color * costheta; } diff --git a/etc/shaders/vertex-color.glsl b/etc/shaders/vertex-color.glsl @@ -34,7 +34,7 @@ vec3 standard_light(vec3 color) { vec3 L = light_dir; vec3 N = normalize(trans_normal.xyz); - float costheta = clamp(dot(L,N), 0.1, 1.0); + float costheta = clamp(dot(L,N), 0.3, 1.0) * light_intensity; return color * costheta; } diff --git a/src/game.c b/src/game.c @@ -105,7 +105,7 @@ void game_init(struct game *game, int width, int height) { terrain->entity.casts_shadows = 0; // player init - ok = load_model(&player->model, "ship"); + ok = load_model(&player->model, "tower"); assert(ok); player->model.shading = SHADING_VERT_COLOR; player->node.label = "player"; diff --git a/src/update.c b/src/update.c @@ -226,7 +226,7 @@ void resize_fbos(struct game *game, int width, int height) { // TODO: match based on some real concept of time static void day_night_cycle(float n, struct resources *res) { - float darkest = 0.2; + float darkest = 0.3; float val = n*200.0; float roots = vec3_dot(res->light_dir, V3(0.0, 0.0, 1.0)); float intensity = clamp(roots, darkest, 1.0);