Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » 5.19 - P

This thread is locked; no one can reply to it. rss feed Print
5.19 - P
Vi_112
Member #15,539
March 2014

Sorry, occationally pressed Enter when entering header...

The question is, why this check is used in _al_ogl_update_render_state()?

if (!(display->flags & ALLEGRO_PROGRAMMABLE_PIPELINE)) {
if (r->alpha_test == 0)
glDisable(GL_ALPHA_TEST);
else
glEnable(GL_ALPHA_TEST);
glAlphaFunc(_gl_funcs[r->alpha_function], r->alpha_test_value);
}

This leads to Allegro not performing alpha test when drawing to depth buffer with ALLEGRO_PROGRAMMABLE_PIPELINE set.

Is this normal behaviour? Maybe default shader should be modified to include alpha test for depth buffer as well?

SiegeLord
Member #7,827
October 2006
avatar

As far as I can tell, that functionality is not present in OpenGL ES 2. I suspect this was in part the reason it was not included.

I think it is in Allegro's interest to have as few OpenGL backends as possible... right now, as far as I can tell it's a mess of GLES, programmable pipeline and fixed function pipeline. It'd be nice if we could collapse GLES and programmable pipeline into one... not sure if that's possible though.

Either way, if it's deemed proper to go GLES-only, then this should be added to the shader.

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

beoran
Member #12,636
March 2011

The static pipeline is important (at least to me) for older systems and on Linux where we don't always have an up to date opengl implementation.

I think the best approach would be to refactor and split up different OpenGL backends and make them completely independent and selectable drivers.

Vi_112
Member #15,539
March 2014

It's a tricky situation for me.

The only thing I use programmable pipeline for is multitexturing, as it is only implemented in Allegro via shaders that requires ALLEGRO_PROGRAMMABLE_PIPELINE.

But I also need Alpha testing when writing to Z_Buffer to correctly draw sprites with transparent regions.

So for me the best thing would be a support of conventional multitexturing, without pixel shaders :)

SiegeLord
Member #7,827
October 2006
avatar

Note that if you're using shaders already, you can write your own that does alpha-testing. I believe you use the discard directive.

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

Elias
Member #358
May 2000

I'd say this is a bug - the default shader should do alpha-testing (if and only if it is turned on). I filed a bug: https://sourceforge.net/p/alleg/bugs/395/

--
"Either help out or stop whining" - Evert

Go to: