Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/shaders/gpu_shader_text_vert.glsl
| uniform mat4 ModelViewProjectionMatrix; | uniform mat4 ModelViewProjectionMatrix; | ||||
| in vec4 pos; /* rect */ | in vec4 pos; /* rect */ | ||||
| in vec4 tex; /* rect */ | in vec4 tex; /* rect */ | ||||
| in vec4 col; | in vec4 col; | ||||
| out vec4 pos_rect; | flat out vec4 color_flat; | ||||
| out vec4 tex_rect; | noperspective out vec2 texCoord_interp; | ||||
| out vec4 color; | |||||
| void main() | void main() | ||||
| { | { | ||||
| pos_rect = pos; | /* Quad expension using instanced rendering. */ | ||||
| tex_rect = tex; | float x = float(gl_VertexID % 2); | ||||
| color = col; | 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; | |||||
| } | } | ||||