Skip to content

Commit

Permalink
Addresses #208.
Browse files Browse the repository at this point in the history
  • Loading branch information
begla committed Mar 13, 2012
1 parent aa49f5a commit 73b8763
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/org/terasology/data/shaders/chunk_frag.glsl
Expand Up @@ -46,6 +46,7 @@ void main(){

vec3 finalLightDir = lightDir;

/* DAYLIGHT BECOMES... MOONLIGHT! */
if (daylight <= 0.0)
finalLightDir *= -1.0;

Expand Down Expand Up @@ -140,10 +141,16 @@ void main(){
float blockBrightness = (blocklightValue * 0.8 + diffuseLighting * blocklightValue * 0.2);

torchlight -= flickering;
if (torchlight < 0.0)
torchlight = 0.0;

blockBrightness += (1.0 - blockBrightness) * torchlight;
blockBrightness -= flickering * blocklightValue;
blockBrightness *= blocklightDayIntensity * 0.75;

if (blockBrightness < 0.0)
blockBrightness = 0.0;

// Calculate the final blocklight color value and add a slight reddish tint to it
vec3 blocklightColorValue = vec3(blockBrightness) * vec3(1.0, 0.95, 0.94);

Expand Down

0 comments on commit 73b8763

Please sign in to comment.