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

depth_2d_update_vert.glsl « kernels « metal « gpu « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: def0c1ae9de533fdb81f22dadde5a5c49967785a (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

void main()
{
  vec4 rect = vec4(offset.x, offset.y, offset.x + extent.x, offset.y + extent.y);
  rect /= vec4(size, size);
  vec4 tex = rect;
  rect = rect * 2.0 - 1.0;

  /* QUAD */
  if (pos.x == 0.0 && pos.y == 0.0) {
    rect.xy = rect.xy;
    texCoord_interp = tex.xy;
  }
  else if (pos.x == 0.0 && pos.y == 1.0) {
    rect.xy = rect.xw;
    texCoord_interp = tex.xw;
  }
  else if (pos.x == 1.0 && pos.y == 1.0) {
    rect.xy = rect.zw;
    texCoord_interp = tex.zw;
  }
  else {
    rect.xy = rect.zy;
    texCoord_interp = tex.zy;
  }
  gl_Position = vec4(rect.xy, 0.0f, 1.0f);
}