17 lines
423 B
Text
17 lines
423 B
Text
|
#version 450 core
|
||
|
|
||
|
layout( location = 0 ) uniform sampler2D u_InputTexture;
|
||
|
layout( location = 1 ) uniform int u_LOD;
|
||
|
layout( location = 2 ) uniform vec2 u_OutputSize;
|
||
|
|
||
|
layout( location = 0 ) out vec4 o_Color;
|
||
|
|
||
|
void main( void )
|
||
|
{
|
||
|
vec2 ts = textureSize( u_InputTexture , u_LOD );
|
||
|
ivec2 pos = ivec2( ts * gl_FragCoord.xy / u_OutputSize );
|
||
|
o_Color = vec4( vec3( texelFetch( u_InputTexture , pos , u_LOD ).a ) ,
|
||
|
1 );
|
||
|
}
|
||
|
|