From 66cde37c5835da39132bb0916f361416cccdda3f Mon Sep 17 00:00:00 2001 From: Harry Date: Sat, 25 Mar 2017 00:16:22 +0000 Subject: [PATCH] Made lighting attenuation linear to temporarily increase vision. --- res/runtime/resources.data | 2 +- res/runtime/shaders/noshadows.fragment.glsl | 4 ++-- res/runtime/worlds/random.world | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/res/runtime/resources.data b/res/runtime/resources.data index f095859ac1..0a6ea5675c 100644 --- a/res/runtime/resources.data +++ b/res/runtime/resources.data @@ -83,4 +83,4 @@ sword.name: Complete Sword torus.path: ../../../res/runtime/models/torus.obj torus.name: Complete Torus speed: 1 -played: 128112 +played: 128302 diff --git a/res/runtime/shaders/noshadows.fragment.glsl b/res/runtime/shaders/noshadows.fragment.glsl index 9d63843822..6dc769ddf3 100644 --- a/res/runtime/shaders/noshadows.fragment.glsl +++ b/res/runtime/shaders/noshadows.fragment.glsl @@ -19,7 +19,7 @@ uniform float parallaxBias; layout(location = 0) out vec4 fragColor; const vec4 lightColour = vec4(1, 1, 1, 1); -const float lightWattage = 5000; +const float lightWattage = 100; const vec3 position_worldspace = (modelMatrix * vec4(position_modelspace, 1.0)).xyz; const vec3 position_cameraspace = (viewMatrix * vec4(position_worldspace, 1.0)).xyz; @@ -29,7 +29,7 @@ const vec3 eyeDirection_cameraspace = vec3(0, 0, 0) - position_cameraspace; const vec3 eyeDirection_tangentspace = tbnMatrix * eyeDirection_cameraspace; const vec3 ld_cameraspace = cameraPosition_cameraspace - position_cameraspace; -const float distance = length(ld_cameraspace); +const float distance = sqrt(length(ld_cameraspace)); const vec3 lightDirection_cameraspace = normalize(ld_cameraspace); const vec3 lightDirection_tangentspace = tbnMatrix * lightDirection_cameraspace; diff --git a/res/runtime/worlds/random.world b/res/runtime/worlds/random.world index 547d2c1af9..e63c124229 100644 --- a/res/runtime/worlds/random.world +++ b/res/runtime/worlds/random.world @@ -263,7 +263,7 @@ object36.scale: [80, 8, 80] object37.mesh: cube object37.texture: metal object37.normalmap: metal_normalmap -object37.parallaxmap: default_parallaxmap +object37.parallaxmap: metal_parallaxmap object37.pos: [141.321, 9, -803.441] object37.rot: [0, -0.0384342, 0] object37.scale: [80, 8, 80] @@ -277,7 +277,7 @@ object38.scale: [80, 8, 80] object39.mesh: cube object39.texture: metal object39.normalmap: metal_normalmap -object39.parallaxmap: default_parallaxmap +object39.parallaxmap: metal_parallaxmap object39.pos: [-0.000628724, -300, -236] object39.rot: [0, 3.14159, 0] object39.scale: [800, 10, 800]