polyadvent

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

commit 8c09c328a4217e9cda18e597960ee312b3386775
parent 902f3b45eda3374a8f16a982983c69e1a7f0f599
Author: William Casarin <jb55@jb55.com>
Date:   Tue, 30 Oct 2018 17:33:12 -0700

fog draw dist

Diffstat:
Metc/shaders/fog.glsl | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/etc/shaders/fog.glsl b/etc/shaders/fog.glsl @@ -2,7 +2,8 @@ vec3 apply_fog(in vec3 rgb, in float distance, in vec3 ray_orig, in vec3 ray_dir) { const float b = 0.00035; - float fog_amount = 1.0-exp(-pow(distance * (1.0/1.2) * b, 6.0)); + float draw_dist = 1.4; + float fog_amount = 1.0-exp(-pow(distance * (1.0/draw_dist) * b, 6.0)); float sun_amount = max( dot( ray_dir, -light_dir ), 0.0 ) * b; sun_amount = pow(sun_amount, 2.0);