This commit is contained in:
Marianne Gagnon 2014-05-03 20:22:26 -04:00
commit 30929ef0a7
4 changed files with 6 additions and 1 deletions

View File

@ -46,6 +46,9 @@ void main()
vec3 light_col = col.xyz;
float d = distance(light_pos, xpos.xyz);
float att = energy * 200. / (1. + 33. * d + 33. * d * d);
float max_d = 20. * energy;
att *= (max_d - d) / max_d;
if (att <= 0.) discard;
// Light Direction
vec3 L = -normalize(xpos.xyz - light_pos);

View File

@ -29,7 +29,7 @@ const float zNear = 1.;
void main(void)
{
// Beyond that value, light is too attenuated
float r = 100 * Energy;
float r = 30 * Energy;
center = Position;
energy = Energy;
vec4 Center = ViewMatrix * vec4(Position, 1.);

View File

@ -15,6 +15,7 @@ uniform mat4 ViewMatrix;
uniform mat4 ProjectionMatrix;
uniform mat4 InverseViewMatrix;
uniform mat4 InverseProjectionMatrix;
uniform mat4 ShadowViewProjMatrixes[4];
#else
layout (std140) uniform MatrixesData
{

View File

@ -10,6 +10,7 @@ uniform mat4 ViewMatrix;
uniform mat4 ProjectionMatrix;
uniform mat4 InverseViewMatrix;
uniform mat4 InverseProjectionMatrix;
uniform mat4 ShadowViewProjMatrixes[4];
#else
layout (std140) uniform MatrixesData
{