When I blend texture in Raspiberry with
gh_renderer.set_blending_state(1)
gh_renderer.set_blending_factors(BLEND_FACTOR_SRC_ALPHA, BLEND_FACTOR_ONE_MINUS_SRC_ALPHA); // 2 & 5
If texture's alpha isn't 1.0 or 0.0, I will watch my desktop in my texture on my screen.
How can I avoid desktop to show at my texture when my texture'alpha is between 1.0 ~ 0.0?
This is something I explain at the end of this post:
http://www.geeks3d.com/20150325/glsl-hacker-0-8-2-for-raspberry-pi-released/
The rendering is directly done on the same framebuffer than the desktop, that could explain why alpha blending makes the desktop to appear.
Currently I didn't find a way to fix it.
I your find a RPi demo somewhere on the web that uses alpha blending, let me know.
There is a RPi demo "drawing_letters_with_mouse"
If you modify code at line 168
from
gh_gpu_program.uniform4f(texture_prog, "color", p._r, p._g, p._b, 1)
to
gh_gpu_program.uniform4f(texture_prog, "color", p._r, p._g, p._b, 0.5)
When you click your left buttom, You will find a magical situation.
You can watch your desktop through letter whatever your bg color in GLSLHacker
(https://fbcdn-sphotos-b-a.akamaihd.net/hphotos-ak-xaf1/v/t1.0-9/12033191_10204949339965304_8935886562271569146_n.jpg?oh=85211d98b470c2bee239901e39b599d0&oe=56689D0A&__gda__=1449595326_25c4bb26f3b535350a46da883be20874)
Yes I know, this demo is included in the code sample pack. What I meant is if you find an OpenGL ES demo with blending for RPi on another website, let me know ;)
I found the solution and now we can fully control the opacity of the window. Available in GeeXLab 0.9.1.0+ (http://www.geeks3d.com/geexlab/downloads/). I posted an article about that topic:
http://www.geeks3d.com/hacklab/20151207/how-to-control-the-window-opacity-on-the-raspberry-pi/