Moved lighting uniforms into light.glsl

This commit is contained in:
Joshua Barretto 2019-07-21 18:57:25 +01:00
parent 5cdfb26e0d
commit 1cf8383eba
5 changed files with 10 additions and 40 deletions

View File

@ -22,16 +22,6 @@ uniform u_bones {
BoneData bones[16];
};
struct Light {
vec4 light_pos;
vec4 light_col;
};
layout (std140)
uniform u_lights {
Light lights[32];
};
#include <sky.glsl>
#include <light.glsl>

View File

@ -22,16 +22,6 @@ uniform u_bones {
BoneData bones[16];
};
struct Light {
vec4 light_pos;
vec4 light_col;
};
layout (std140)
uniform u_lights {
Light lights[32];
};
out vec3 f_pos;
out vec3 f_norm;
out vec3 f_col;

View File

@ -1,3 +1,13 @@
struct Light {
vec4 light_pos;
vec4 light_col;
};
layout (std140)
uniform u_lights {
Light lights[32];
};
float attenuation_strength(vec3 rpos) {
return 1.0 / (rpos.x * rpos.x + rpos.y * rpos.y + rpos.z * rpos.z);
}

View File

@ -12,16 +12,6 @@ uniform u_locals {
vec3 model_offs;
};
struct Light {
vec4 light_pos;
vec4 light_col;
};
layout (std140)
uniform u_lights {
Light lights[32];
};
out vec4 tgt_color;
#include <sky.glsl>

View File

@ -10,16 +10,6 @@ uniform u_locals {
vec3 model_offs;
};
struct Light {
vec4 light_pos;
vec4 light_col;
};
layout (std140)
uniform u_lights {
Light lights[32];
};
out vec3 f_pos;
flat out uint f_pos_norm;
out vec3 f_col;