Debian Codegraph @

src/base_rendering/glsl/generated-pascal/image.vs.inc

raw
1 { -*- buffer-read-only: t -*- }
2 { DON'T EDIT -- this file was automatically generated from "image.vs" }
3 'attribute vec2 vertex;' + LineEnding +
4 'attribute vec2 tex_coord;' + LineEnding +
5 '' + LineEnding +
6 '/* Note that passing viewport_size (just 2 floats) removes the need to pass' + LineEnding +
7 ' a projection_matrix (16 floats).' + LineEnding +
8 '' + LineEnding +
9 ' We only pass a size of the context (width, height),' + LineEnding +
10 ' since we know that the viewport for 2D drawing is always the full context,' + LineEnding +
11 ' with coordinates matching pixels.' + LineEnding +
12 ' (TCastleWindow.EventRender even sets such projection matrix,' + LineEnding +
13 ' although we don''t depend on it for TDrawableImage rendering after all.)' + LineEnding +
14 ' This allows us to simplify' + LineEnding +
15 ' gl_Position = projection_matrix * vec4(vertex, 0.0, 1.0);' + LineEnding +
16 ' because we know that the projection_matrix actually corresponds to' + LineEnding +
17 ' OrthoProjection(0, viewport_size.x, 0, viewport_size.y);' + LineEnding +
18 '*/' + LineEnding +
19 'uniform vec2 viewport_size;' + LineEnding +
20 'varying vec2 tex_coord_frag;' + LineEnding +
21 '' + LineEnding +
22 '#ifdef CLIP_LINE' + LineEnding +
23 'varying vec2 frag_coord;' + LineEnding +
24 '#endif' + LineEnding +
25 '' + LineEnding +
26 '/* Simple GLSL shader to apply 2D texture.' + LineEnding +
27 ' Must be suitable also for GLES20, so don''t use any deprecated gl_Xxx' + LineEnding +
28 ' variables. */' + LineEnding +
29 '' + LineEnding +
30 'void main(void)' + LineEnding +
31 '{' + LineEnding +
32 ' gl_Position = vec4(vertex * 2.0 / viewport_size - vec2(1.0), 0.0, 1.0);' + LineEnding +
33 ' #ifdef CLIP_LINE' + LineEnding +
34 ' frag_coord = vertex;' + LineEnding +
35 ' #endif' + LineEnding +
36 ' tex_coord_frag = tex_coord;' + LineEnding +
37 '}' + LineEnding +
38 ''