Commit: 4c7ff8fb1e3c59439cdd8181b10f6b6dfc478033
Author: Dalai Felinto
Date:   Wed Sep 28 18:48:51 2016 +0000
Branches: blender2.8
https://developer.blender.org/rB4c7ff8fb1e3c59439cdd8181b10f6b6dfc478033

Fix animation transition in region overlay not working since 4a1feaa5

We still have stills with the User Preference window, though.

===================================================================

M       source/blender/gpu/gawain/immediate.c
M       source/blender/gpu/gawain/immediate.h
M       source/blender/gpu/shaders/gpu_shader_2D_texture_2D_frag.glsl
M       source/blender/gpu/shaders/gpu_shader_2D_texture_rect_frag.glsl
M       source/blender/windowmanager/intern/wm_draw.c
M       source/blender/windowmanager/intern/wm_stereo.c

===================================================================

diff --git a/source/blender/gpu/gawain/immediate.c 
b/source/blender/gpu/gawain/immediate.c
index 9c3904f..7edc4e2 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 84fb076..3fcf856 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 6029fd8..69bc616 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 d32b8ba..75298bc 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 4303ce3..e9eaa56 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 ea9a09d..e2b6df6 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);

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to