mirror of
https://github.com/tanema/light_world.lua.git
synced 2024-12-24 20:24:19 +00:00
7fe549a01a
-cut out complicated light angle calulations and instead put in a arc stencil -stenciled the range of each light to optimize the shader drawing -refactors postshaders to user proper love variables -minimized amount of canvases -added better functionality to my canvas util -refactored blurring to be in one place
14 lines
513 B
GLSL
14 lines
513 B
GLSL
extern float exposure = 0.7;
|
|
extern float brightness = 1.0;
|
|
extern vec3 lumacomponents = vec3(1.0, 1.0, 1.0);
|
|
const vec3 lumcoeff = vec3(0.212671, 0.715160, 0.072169);
|
|
|
|
vec4 effect(vec4 vcolor, Image texture, vec2 texcoord, vec2 pixel_coords) {
|
|
vec4 input0 = Texel(texture, texcoord);
|
|
input0 *= (exp2(input0)*vec4(exposure));
|
|
vec4 lumacomponents = vec4(lumcoeff * lumacomponents, 0.0 );
|
|
float luminance = dot(input0,lumacomponents);
|
|
vec4 luma = vec4(luminance);
|
|
return vec4(luma.rgb * brightness, 1.0);
|
|
}
|