Author Topic: When texture alpha between 1.0~0.0 In Raspiberry, I will watch my Desktop  (Read 7123 times)

0 Members and 1 Guest are viewing this topic.

asail0712

  • Newbie
  • *
  • Posts: 5
    • View Profile
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?


JeGX

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2035
    • View Profile
    • Geeks3D.com
Re: When texture alpha between 1.0~0.0 In Raspiberry, I will watch my Desktop
« Reply #1 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.

asail0712

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: When texture alpha between 1.0~0.0 In Raspiberry, I will watch my Desktop
« Reply #2 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



JeGX

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2035
    • View Profile
    • Geeks3D.com
Re: When texture alpha between 1.0~0.0 In Raspiberry, I will watch my Desktop
« Reply #3 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  ;)

JeGX

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2035
    • View Profile
    • Geeks3D.com
Re: When texture alpha between 1.0~0.0 In Raspiberry, I will watch my Desktop
« Reply #4 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+. I posted an article about that topic:

http://www.geeks3d.com/hacklab/20151207/how-to-control-the-window-opacity-on-the-raspberry-pi/