diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2016-09-28 21:48:51 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2016-09-28 21:48:51 +0300 |
commit | 4c7ff8fb1e3c59439cdd8181b10f6b6dfc478033 (patch) | |
tree | bab137dbbf8027d63328312f9ea3ba1853ddeab3 /source | |
parent | 83d5a919e26affaa4e81258e629fe048215f6a04 (diff) |
Fix animation transition in region overlay not working since 4a1feaa5
We still have stills with the User Preference window, though.
Diffstat (limited to 'source')
6 files changed, 18 insertions, 2 deletions
diff --git a/source/blender/gpu/gawain/immediate.c b/source/blender/gpu/gawain/immediate.c index 9c3904f21cb..7edc4e2caaf 100644 --- a/source/blender/gpu/gawain/immediate.c +++ b/source/blender/gpu/gawain/immediate.c @@ -622,6 +622,17 @@ void immVertex3fv(unsigned attrib_id, const float data[3]) immEndVertex(); } +void immUniform1f(const char* name, float x) +{ + int loc = glGetUniformLocation(imm.bound_program, name); + +#if TRUST_NO_ONE + assert(loc != -1); +#endif + + glUniform1f(loc, x); +} + void immUniform4f(const char* name, float x, float y, float z, float w) { int loc = glGetUniformLocation(imm.bound_program, name); diff --git a/source/blender/gpu/gawain/immediate.h b/source/blender/gpu/gawain/immediate.h index 84fb0760e2e..3fcf85607c3 100644 --- a/source/blender/gpu/gawain/immediate.h +++ b/source/blender/gpu/gawain/immediate.h @@ -66,6 +66,7 @@ void immVertex3fv(unsigned attrib_id, const float data[3]); void immVertex2iv(unsigned attrib_id, const int data[2]); // provide values that don't change for the entire draw call +void immUniform1f(const char* name, float x); void immUniform4f(const char* name, float x, float y, float z, float w); // these set "uniform vec4 color" diff --git a/source/blender/gpu/shaders/gpu_shader_2D_texture_2D_frag.glsl b/source/blender/gpu/shaders/gpu_shader_2D_texture_2D_frag.glsl index 6029fd89f64..69bc616db22 100644 --- a/source/blender/gpu/shaders/gpu_shader_2D_texture_2D_frag.glsl +++ b/source/blender/gpu/shaders/gpu_shader_2D_texture_2D_frag.glsl @@ -6,9 +6,10 @@ out vec4 fragColor; #endif +uniform float alpha; uniform sampler2D texture_map; void main() { - fragColor = texture2D(texture_map, texture_coord); + fragColor = vec4(texture2D(texture_map, texture_coord).rgb, alpha); } diff --git a/source/blender/gpu/shaders/gpu_shader_2D_texture_rect_frag.glsl b/source/blender/gpu/shaders/gpu_shader_2D_texture_rect_frag.glsl index d32b8bac3b8..75298bcb5c5 100644 --- a/source/blender/gpu/shaders/gpu_shader_2D_texture_rect_frag.glsl +++ b/source/blender/gpu/shaders/gpu_shader_2D_texture_rect_frag.glsl @@ -6,9 +6,10 @@ out vec4 fragColor; #endif +uniform float alpha; uniform sampler2DRect texture_map; void main() { - fragColor = texture2DRect(texture_map, texture_coord); + fragColor = vec4(texture2DRect(texture_map, texture_coord).rgb, alpha); } diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c index 4303ce30d9e..e9eaa5677e4 100644 --- a/source/blender/windowmanager/intern/wm_draw.c +++ b/source/blender/windowmanager/intern/wm_draw.c @@ -455,6 +455,7 @@ void wm_triple_draw_textures(wmWindow *win, wmDrawTriple *triple, float alpha) glBindTexture(triple->target, triple->bind); + immUniform1f("alpha", alpha); immUniform1i("texture_map", 0); immBegin(GL_QUADS, 4); diff --git a/source/blender/windowmanager/intern/wm_stereo.c b/source/blender/windowmanager/intern/wm_stereo.c index ea9a09d1a34..e2b6df65ce8 100644 --- a/source/blender/windowmanager/intern/wm_stereo.c +++ b/source/blender/windowmanager/intern/wm_stereo.c @@ -282,6 +282,7 @@ static void wm_method_draw_stereo3d_topbottom(wmWindow *win) glBindTexture(triple->target, triple->bind); + immUniform1f("alpha", 1.0f); immUniform1i("texture_map", 0); immBegin(GL_QUADS, 4); |