Skip to content

Commit

Permalink
Made lighting attenuation linear to temporarily increase vision.
Browse files Browse the repository at this point in the history
  • Loading branch information
harrand committed Mar 25, 2017
1 parent 4768582 commit 66cde37
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion res/runtime/resources.data
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions res/runtime/shaders/noshadows.fragment.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions res/runtime/worlds/random.world
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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]
Expand Down

0 comments on commit 66cde37

Please sign in to comment.