20 lines
525 B
GLSL
20 lines
525 B
GLSL
#version 450 core
|
|
|
|
layout( location = 0 ) uniform sampler2D u_MainInput;
|
|
layout( location = 1 ) uniform sampler2D u_BlurInput;
|
|
layout( location = 2 ) uniform vec2 u_OutputSize;
|
|
|
|
layout( location = 0 ) out vec3 color;
|
|
|
|
void main( void )
|
|
{
|
|
vec2 tmp = gl_FragCoord.xy / u_OutputSize;
|
|
float f = .7;
|
|
color = textureLod( u_MainInput , tmp , 0 ).rgb;
|
|
for ( int i = 0 ; i < 5 ; i ++ ) {
|
|
color += f * textureLod( u_BlurInput , tmp , i ).rgb;
|
|
f *= .7;
|
|
}
|
|
color = color / ( color + 1. );
|
|
color = pow( color , vec3( 2.2 ) );
|
|
}
|