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

workbench_effect_taa_frag.glsl « shaders « workbench « engines « draw « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0c4dee117564e74857ca5691f7c7dab1cc52004b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

void main()
{
  vec2 texel_size = 1.0 / vec2(textureSize(colorBuffer, 0));
  vec2 uv = gl_FragCoord.xy * texel_size;

  fragColor = vec4(0.0);
  int i = 0;
  for (int x = -1; x <= 1; x++) {
    for (int y = -1; y <= 1; y++, i++) {
      /* Use log2 space to avoid highlights creating too much aliasing. */
      vec4 color = log2(texture(colorBuffer, uv + vec2(x, y) * texel_size) + 0.5);

      fragColor += color * samplesWeights[i];
    }
  }
}