Rmove overlay framebuffer, directly draw overlay instead
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#version 450 core
|
||||
layout(local_size_x= 16, local_size_y=1) in;
|
||||
layout(local_size_x= 20, local_size_y=1) in;
|
||||
layout(rgba8, binding = 5) uniform restrict writeonly image2D img_output;
|
||||
layout (std140, binding = 1) uniform LightsBlock
|
||||
{
|
||||
@@ -13,7 +13,7 @@ void main ()
|
||||
shared vec3[20] larray;
|
||||
uint i = gl_LocalInvocationID.x;
|
||||
vec3 lightamount = vec3(0,0,0);
|
||||
ivec2 pixel_coords = ivec2(gl_GlobalInvocationID.xy);
|
||||
ivec2 pixel_coords = ivec2(gl_WorkGroupID.xy);
|
||||
vec2 tex_coords = vec2((4*pixel_coords.x+4)/800.0, (4*pixel_coords.y+4)/835.0);
|
||||
vec3 pos = texture(posTexture,tex_coords).xyz;
|
||||
vec3 lightPos = posBool[i].xyz;
|
||||
@@ -26,15 +26,15 @@ void main ()
|
||||
float x = 1 - dist / lumRad.a;
|
||||
vec3 norm = texture(normals,tex_coords).xyz;
|
||||
float y1 = dot(normalize(norm), normalize(distVec));
|
||||
float y = float(y1 > 0 ? 1 : 0);
|
||||
float y = float(y1 > 0 ? 0 : 1);
|
||||
lightamount = y*x*lumRad.rgb;
|
||||
|
||||
}
|
||||
larray[i] = lightamount;
|
||||
if (i == 0)
|
||||
//{ vec3 inverselight = 1 - lightamount;
|
||||
{ vec3 inverselight = vec3(0,0,0);
|
||||
// for (uint j=1 ; j < 20; ++j) {inverselight = inverselight * (1 - larray[j]);}
|
||||
{ vec3 inverselight = 1 - lightamount;
|
||||
//{ vec3 inverselight = vec3(0,0,0);
|
||||
for (uint j=1 ; j < 20; ++j) {inverselight = inverselight * (1 - larray[j]);}
|
||||
imageStore(img_output, pixel_coords, vec4(inverselight,1));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user