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

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

#pragma BLENDER_REQUIRE(common_view_lib.glsl)
#pragma BLENDER_REQUIRE(common_math_lib.glsl)

void main()
{
  float len_sqr = len_squared(interp.coord);
  if (len_sqr > 1.0) {
    discard;
  }

  vec3 vN = vec3(interp.coord, sqrt(1.0 - len_sqr));
  vec3 N = normal_view_to_world(vN);

  vec3 V = cameraVec(interp.P);
  vec3 R = -reflect(V, N);

  out_color.rgb = textureLod(lightprobe_cube_tx, vec4(R, interp.samp), 0.0).rgb;
  out_color.a = 0.0;
}