diff options
author | Mike Erwin <significant.bit@gmail.com> | 2016-08-04 22:59:38 +0300 |
---|---|---|
committer | Mike Erwin <significant.bit@gmail.com> | 2016-08-04 22:59:38 +0300 |
commit | 396dd824285d7fb524fcc8ad8ca4cddddf2efb6d (patch) | |
tree | 7dffad11682a6ac2ec66a9598a7ebe8893b01ffb /source/blender/gpu/shaders/gpu_shader_2D_smooth_color_vert.glsl | |
parent | 797f1896fa023c0404965b987a7334448857c665 (diff) |
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.
Diffstat (limited to 'source/blender/gpu/shaders/gpu_shader_2D_smooth_color_vert.glsl')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_2D_smooth_color_vert.glsl | 18 |
1 files changed, 18 insertions, 0 deletions
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; +} |