Remove individual uniforms from instancing light maps

This commit is contained in:
2023-03-10 14:11:25 +00:00
parent c8b256c939
commit 5724a0543e
6 changed files with 21 additions and 22 deletions
+6 -6
View File
@@ -2,13 +2,13 @@
layout (triangles) in;
layout (triangle_strip, max_vertices = 3) out;
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
//layout (std140, binding = 1) uniform LightsBlock
//{
// vec4 posBool[20];
// vec4 colRad[20];
//} ;
uniform vec3 lightPos;
layout (std140, binding = 1) uniform LightsBlock
{
vec4 posBool[20];
vec4 colRad[20];
} ;
uniform int lightID;
vec3 lightPos = posBool[lightID].xyz ;
// this code is duplicated in lineShadow.geom, should not be changed on its own
vec4 projNear (vec4 pos)
{
-3
View File
@@ -7,11 +7,8 @@ layout (std140, binding = 1) uniform LightsBlock
vec4 posBool[20];
vec4 colRad[20];
} ;
//uniform vec3 lightPos;
//uniform float radiusUniform;
uniform int lightID;
vec3 lightPos1 = posBool[lightID].xyz;
//vec3 lightPos1 = lightPos;
float theBool = posBool[lightID].w;
vec4 shift (vec4 p) { return (vec4 (p.xyz + (100000*(p.xyz-lightPos1)), 1));} ;
vec4 shiftBy (float x,vec4 p) { return (vec4 (lightPos1 + (x*normalize(p.xyz-lightPos1)), 1));} ;
+3 -2
View File
@@ -4,8 +4,9 @@ layout (std140, binding = 1) uniform LightsBlock
vec4 posBool[20];
vec4 colRad[20];
} ;
uniform vec3 lightPos;
uniform vec4 lumRad;
uniform int lightID;
vec3 lightPos = posBool[lightID].xyz;
vec4 lumRad = colRad[lightID];
uniform sampler2D screenTexture;
in vec2 vTexPos;
out vec4 fColor;
+1 -1
View File
@@ -7,8 +7,8 @@ layout (std140, binding = 1) uniform LightsBlock
vec4 posBool[20];
vec4 colRad[20];
} ;
uniform vec3 lightPos;
uniform int lightID;
vec3 lightPos = posBool[lightID].xyz;
vec4 shift (vec4 p)
{ return vec4 (p.xy + (200 * (p.xy-lightPos.xy)), 0 , 1);
}