When texture alpha between 1.0~0.0 In Raspiberry, I will watch my Desktop

Started by asail0712, September 14, 2015, 02:39:51 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

asail0712

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

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

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

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  ;)