Geeks3D Forums

GeeXLab => GeeXLab - english forum => Topic started by: asail0712 on September 14, 2015, 02:39:51 PM

Title: When texture alpha between 1.0~0.0 In Raspiberry, I will watch my Desktop
Post by: asail0712 on September 14, 2015, 02:39:51 PM
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?
Title: Re: When texture alpha between 1.0~0.0 In Raspiberry, I will watch my Desktop
Post by: JeGX on September 17, 2015, 04:29:55 PM
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.
Title: Re: When texture alpha between 1.0~0.0 In Raspiberry, I will watch my Desktop
Post by: asail0712 on September 18, 2015, 04:31:03 AM
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)

Title: Re: When texture alpha between 1.0~0.0 In Raspiberry, I will watch my Desktop
Post by: JeGX on September 21, 2015, 01:11:25 PM
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  ;)
Title: Re: When texture alpha between 1.0~0.0 In Raspiberry, I will watch my Desktop
Post by: JeGX on December 07, 2015, 12:31:48 PM
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/