Welcome to mirror list, hosted at ThFree Co, Russian Federation.

effect_downsample_frag.glsl « shaders « eevee « engines « draw « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1e57aec5ea29ed915925f31f33c9a5c6081e4521 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/**
 * Simple downsample shader. Takes the average of the 4 texels of lower mip.
 **/

uniform sampler2D source;

out vec4 FragColor;

void main()
{
	/* Reconstructing Target uvs like this avoid missing pixels if NPO2 */
	vec2 uvs = gl_FragCoord.xy * 2.0 / vec2(textureSize(source, 0));

	FragColor = textureLod(source, uvs, 0.0);
}