From 396dd824285d7fb524fcc8ad8ca4cddddf2efb6d Mon Sep 17 00:00:00 2001 From: Mike Erwin Date: Thu, 4 Aug 2016 15:59:38 -0400 Subject: OpenGL: add simple shaders for 2D drawing The first two of several new simple built-in shaders (will test these before adding more). These are intended for the new immediate mode API, but you can use them just like any built-in GPUShader. Due to limitations on different platforms, shaders need to work with GLSL versions 120, 130 and 150. Final Blender 2.8 will be pure #version 150. --- .../gpu/shaders/gpu_shader_2D_smooth_color_vert.glsl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 source/blender/gpu/shaders/gpu_shader_2D_smooth_color_vert.glsl (limited to 'source/blender/gpu/shaders/gpu_shader_2D_smooth_color_vert.glsl') diff --git a/source/blender/gpu/shaders/gpu_shader_2D_smooth_color_vert.glsl b/source/blender/gpu/shaders/gpu_shader_2D_smooth_color_vert.glsl new file mode 100644 index 00000000000..e74485bfa4f --- /dev/null +++ b/source/blender/gpu/shaders/gpu_shader_2D_smooth_color_vert.glsl @@ -0,0 +1,18 @@ + +#if __VERSION__ == 120 + attribute vec2 pos; + attribute vec4 color; + + varying vec4 finalColor; +#else + in vec2 pos; + in vec4 color; + + noperspective out vec4 finalColor; +#endif + +void main() +{ + gl_Position = gl_ModelViewMatrix * vec4(pos, 0.0, 1.0); + finalColor = color; +} -- cgit v1.2.3