Improved lighting

This commit is contained in:
Joshua Barretto 2020-09-03 17:52:21 +01:00
parent b24f5b5b24
commit 70f52d876a
6 changed files with 8 additions and 9 deletions

View File

@ -5,8 +5,8 @@ Item(
( (
kind: "Black0", kind: "Black0",
color: (r: 255, g: 128, b: 26), color: (r: 255, g: 128, b: 26),
strength_thousandths: 3000, strength_thousandths: 5000,
flicker_thousandths: 300, flicker_thousandths: 150,
), ),
), ),
) )

View File

@ -5,7 +5,7 @@ Item(
( (
kind: "Blue0", kind: "Blue0",
color: (r: 255, g: 128, b: 26), color: (r: 255, g: 128, b: 26),
strength_thousandths: 4000, strength_thousandths: 6000,
flicker_thousandths: 250, flicker_thousandths: 250,
), ),
), ),

View File

@ -5,8 +5,8 @@ Item(
( (
kind: "Green0", kind: "Green0",
color: (r: 255, g: 128, b: 26), color: (r: 255, g: 128, b: 26),
strength_thousandths: 4000, strength_thousandths: 6000,
flicker_thousandths: 500, flicker_thousandths: 250,
), ),
), ),
) )

View File

@ -5,8 +5,8 @@ Item(
( (
kind: "Red0", kind: "Red0",
color: (r: 255, g: 128, b: 26), color: (r: 255, g: 128, b: 26),
strength_thousandths: 3500, strength_thousandths: 5000,
flicker_thousandths: 1000, flicker_thousandths: 250,
), ),
), ),
) )

View File

@ -142,7 +142,7 @@ float lights_at(vec3 wpos, vec3 wnorm, vec3 /*cam_to_frag*/view_dir, vec3 mu, ve
// float strength = attenuation_strength(difference);// pow(attenuation_strength(difference), 0.6); // float strength = attenuation_strength(difference);// pow(attenuation_strength(difference), 0.6);
// // NOTE: This normalizes strength to 1.0 at the center of the point source. // // NOTE: This normalizes strength to 1.0 at the center of the point source.
// float strength = 1.0 / (1.0 + distance_2); // float strength = 1.0 / (1.0 + distance_2);
float strength = 1.0 / (1 + distance_2); float strength = 1.0 / (4 + distance_2);
// Multiply the vec3 only once // Multiply the vec3 only once
const float PI = 3.1415926535897932384626433832795; const float PI = 3.1415926535897932384626433832795;

View File

@ -14,7 +14,6 @@ use common::{
spiral::Spiral2d, spiral::Spiral2d,
state::DeltaTime, state::DeltaTime,
terrain::TerrainChunk, terrain::TerrainChunk,
time::DayPeriod,
vol::{RectRasterableVol, SizedVol}, vol::{RectRasterableVol, SizedVol},
}; };
use dot_vox::DotVoxData; use dot_vox::DotVoxData;