Add lighting shader

This commit is contained in:
schmelczerandras 2020-07-22 22:47:26 +02:00
parent e88b4589d2
commit 0cd383794c
11 changed files with 144 additions and 295 deletions

View file

@ -36,11 +36,11 @@ float getDistance(in vec2 target) {
return -minDistance;
}
uniform mat3 transform;
uniform mat3 distanceScreenToWorld;
out vec4 fragmentColor;
void main() {
vec2 position = (vec3(gl_FragCoord.xy, 1.0) * transform).xy;
vec2 position = (vec3(gl_FragCoord.xy, 1.0) * distanceScreenToWorld).xy;
float distance = getDistance(position);
fragmentColor = vec4(vec3(0.0), distance / 256.0 + 0.5);
}