Move towards geometry instancing for shadows

This commit is contained in:
2023-03-10 13:55:41 +00:00
parent cda7116930
commit c8b256c939
14 changed files with 303 additions and 17 deletions
+20
View File
@@ -0,0 +1,20 @@
#version 450 core
layout (std140, binding = 1) uniform LightsBlock
{
vec4 posBool[20];
vec4 colRad[20];
} ;
uniform vec3 lightPos;
uniform vec4 lumRad;
uniform sampler2D screenTexture;
in vec2 vTexPos;
out vec4 fColor;
void main()
{
vec3 distVec = texture(screenTexture,vTexPos).xyz - lightPos;
float dist = dot(distVec,distVec);
if (dist > lumRad.a) {discard;}
float x = 1 - dist / lumRad.a ;
vec3 c = (x * x * x) * lumRad.rgb ;
fColor = vec4(c,0);
}