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

eevee_film_resolve_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: a2960a85278bd46e977501d7c2fc8b4396b0d2e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

#pragma BLENDER_REQUIRE(eevee_film_lib.glsl)

void main(void)
{
  vec2 uv = uvcoordsvar.xy;

  vec4 color = textureLod(data_tx, uv, 0.0);
  float weight = textureLod(weight_tx, uv, 0.0).r;

  out_color = film_data_decode(film, color, weight);

  if (film.opacity < 1.0) {
    /* First sample is stored in a fullscreen buffer. */
    vec2 uv_first_sample = ((uv * film.extent) + film.offset) /
                           vec2(textureSize(first_sample_tx, 0).xy);
    vec4 first_sample = textureLod(first_sample_tx, uv_first_sample, 0.0);
    out_color = mix(first_sample, out_color, film.opacity);
  }
}