polyadvent

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

commit 99fe0cba8c019ae3d9f9636d3bc90e1815270851
parent 4e54fd135acb816fc775056961953ade73af428c
Author: William Casarin <jb55@jb55.com>
Date:   Sun, 18 Nov 2018 16:13:32 -0800

brown terrain

Diffstat:
Metc/shaders/lighting.glsl | 6+++---
Metc/shaders/terrain.v.glsl | 22+++++++++++++++-------
2 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/etc/shaders/lighting.glsl b/etc/shaders/lighting.glsl @@ -32,10 +32,10 @@ vec3 uncharted_tonemap(const vec3 x) { vec3 standard_light(vec3 color, vec4 position, vec4 normal) { // vec3 light_dir = vec3() - const float shiny = 14.0; - const float exposure = 0.3; + const float shiny = 10.0; + const float exposure = 0.2; float ambient_str = 0.2; - float spec_str = 0.8 * light_intensity; + float spec_str = 0.7 * light_intensity; vec4 trans_normal = normal_matrix * normal; vec3 L = light_dir; diff --git a/etc/shaders/terrain.v.glsl b/etc/shaders/terrain.v.glsl @@ -13,18 +13,26 @@ out shader_data { void main() { - const int nlands = 6; - + const int nlands = 2; const vec4 land[nlands] = vec4[]( - vec4(0.0, 0.5, 0.79, 0.0), // 0 - water + // vec4(0.0, 0.5, 0.79, 0.0), // 0 - water vec4(0.9176, 0.8156, 0.6588, 1.0), // 1 - sand - vec4(0.7, 0.7, 0.156, 2.0), // 2 - grass - vec4(0.4627, 0.3333, 0.1686, 20.0), // 3 - dirt - vec4(0.5, 0.5, 0.5, 80.0), // 4 - stone - vec4(1.0, 1.0, 1.0, 380.0) // 5 - snow + // vec4(0.7, 0.7, 0.156, 2.0), // 2 - grass + vec4(0.4627, 0.3333, 0.1686, 20.0) // 3 - dirt + // vec4(0.5, 0.5, 0.5, 80.0), // 4 - stone + // vec4(1.0, 1.0, 1.0, 380.0) // 5 - snow ); + // const vec4 land[nlands] = vec4[]( + // vec4(0.0, 0.5, 0.79, 0.0), // 0 - water + // vec4(0.9176, 0.8156, 0.6588, 1.0), // 1 - sand + // vec4(0.7, 0.7, 0.156, 2.0), // 2 - grass + // vec4(0.4627, 0.3333, 0.1686, 20.0), // 3 - dirt + // vec4(0.5, 0.5, 0.5, 80.0), // 4 - stone + // vec4(1.0, 1.0, 1.0, 380.0) // 5 - snow + // ); + vec3 color = land[0].xyz; for (int i = 0; i < nlands-1; i++) { color =