polyadvent

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

commit 1eb515faf1cea880b1b913261f98e6f0cbd877ca
parent 635d96fefc2ed50d991870ccdd8d17552ec5cc1d
Author: William Casarin <jb55@jb55.com>
Date:   Mon, 12 Nov 2018 19:47:58 -0800

crank ambient

Diffstat:
Metc/shaders/pbr.glsl | 9+++++----
Msrc/update.c | 3+++
2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/etc/shaders/pbr.glsl b/etc/shaders/pbr.glsl @@ -40,10 +40,10 @@ vec3 fresnel_schlick(float cos_theta, vec3 F0) } vec3 pbr(vec3 albedo, vec3 V, vec3 normal) { - const float ao = 5.0; + const float ao = 12.0; const float metallic = 0.6; - const float roughness = 0.4; - vec3 radiance = sun_color * light_intensity; + const float roughness = 0.6; + vec3 radiance = sun_color * light_intensity * 2.0; // radiance += texture(skybox, vec3(0.0, 0.0, 1.0)).rgb; vec3 N = normalize(normal); vec3 L = normalize(light_dir); @@ -78,12 +78,13 @@ vec3 pbr(vec3 albedo, vec3 V, vec3 normal) { // Lo = outgoing radiance // the result of the reflectance equation's integral ∫ over Ω + vec3 Lo = (kD * albedo / PI + specular) * radiance * NdotL; vec3 ambient = vec3(0.03) * albedo * ao; vec3 color = ambient + Lo; // color = uncharted_tonemap(color); - //color = color / (vec3(1.0) + color); + // color = color / (vec3(1.0) + color); return color; } diff --git a/src/update.c b/src/update.c @@ -337,6 +337,9 @@ static void player_update(struct game *game, struct entity *player) { orbit_keep_above_ground(game); + /* look_at(node_world(&camera->node), node_world(&player->node), UP_VEC, */ + /* camera->node.mat); */ + // move player camera toward camera orientation if (input_is_dragging(&game->input, SDL_BUTTON_RIGHT)) { float yaw = game->test_resources.camera.coords.azimuth;