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

gpu_shader_text_vert.glsl « shaders « gpu « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 28437208e912bd1c5cbe872394834fe6187e8317 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

uniform mat4 ModelViewProjectionMatrix;

in vec4 pos; /* rect */
in vec4 tex; /* rect */
in vec4 col;

flat out vec4 color_flat;
noperspective out vec2 texCoord_interp;

void main()
{
  /* Quad expension using instanced rendering. */
  float x = float(gl_VertexID % 2);
  float y = float(gl_VertexID / 2);
  vec2 quad = vec2(x, y);

  gl_Position = ModelViewProjectionMatrix * vec4(mix(pos.xy, pos.zw, quad), 0.0, 1.0);
  texCoord_interp = mix(abs(tex.xy), abs(tex.zw), quad) * sign(tex.xw);
  color_flat = col;
}