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

shadow_process_vert.glsl « shaders « eevee « engines « draw « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 95e6a48b81f5fd426f4e49a638e044a8c5331ca2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

layout(std140) uniform shadow_render_block
{
  /* Use vectors to avoid alignment padding. */
  ivec4 shadowSampleCount;
  vec4 shadowInvSampleCount;
  vec4 filterSize;
  int viewCount;
  int baseId;
  float cubeTexelSize;
  float storedTexelSize;
  float nearClip;
  float farClip;
  float exponent;
};

out int layerID_g;

void main()
{
  int v = gl_VertexID % 3;
  layerID_g = gl_VertexID / 3;
  float x = -1.0 + float((v & 1) << 2);
  float y = -1.0 + float((v & 2) << 1);
  gl_Position = vec4(x, y, 1.0, 1.0);

  /* HACK avoid changing drawcall parameters. */
  if (layerID_g >= viewCount) {
    gl_Position = vec4(0.0);
  }
  layerID_g += baseId;
}