From 7a60f889d3f328e38aa882891cda615a06333ab6 Mon Sep 17 00:00:00 2001 From: Mike Erwin Date: Sun, 9 Oct 2016 23:03:35 -0400 Subject: OpenGL: plug new matrix system into shaders (WIP) Built-in shaders now use uniforms instead of legacy built-in matrices. So far I only hooked this up for new immediate mode. We use the same matrix naming convention as OpenGL, but without the gl_ prefix, e.g. gl_ModelView becomes ModelView. Right now it can skip the new matrix stack and use the legacy built-in matrices app-side. This will help us transition gradually from glMatrix functions to gpuMatrix functions. Still some work to do in gpuBindMatrices. See TODO comments in gpu_matrix.c for specifics. --- source/blender/gpu/shaders/gpu_shader_3D_flat_color_vert.glsl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/blender/gpu/shaders/gpu_shader_3D_flat_color_vert.glsl') diff --git a/source/blender/gpu/shaders/gpu_shader_3D_flat_color_vert.glsl b/source/blender/gpu/shaders/gpu_shader_3D_flat_color_vert.glsl index ec6037e5077..8c241cff5d4 100644 --- a/source/blender/gpu/shaders/gpu_shader_3D_flat_color_vert.glsl +++ b/source/blender/gpu/shaders/gpu_shader_3D_flat_color_vert.glsl @@ -1,4 +1,6 @@ +uniform mat4 ModelViewProjectionMatrix; + #if __VERSION__ == 120 attribute vec3 pos; attribute vec4 color; @@ -13,6 +15,6 @@ void main() { - gl_Position = gl_ModelViewProjectionMatrix * vec4(pos, 1.0); + gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0); finalColor = color; } -- cgit v1.2.3