I want to use shaders to create a 2d shadowing effect like this
I have a simple shader that i can apply to the current display, and that works fine. Like this:
But when i try to use the shaders with a bitmap i cant make this to work.
Basically i want to apply the shader to a bitmap like this:
Maybe is something im missing since im new to allegro, any idea?
Im using the last source version of allegro.
It should work, I just tried it on Linux and it seemed fine. What platform are you on?
Im on Windows 7 32 bits, Visual Studio 2013, and last Allegro version.
Interesting. I tried it on Windows myself, and it seemed to work ok.
Try adding this line before al_init() to enable logging (it'll generate an allegro.log file in your working directory when you run the program):
al_set_config_value(al_get_system_config(), "trace", "level", "debug");
It'll be useful to look at that log.
Additionally, try doing this before you create the display to force OpenGL mode (by default, Allegro uses Direct3D on Windows):
al_set_new_display_flags(ALLEGRO_PROGRAMMABLE_PIPELINE | ALLEGRO_OPENGL);
Lastly, it'll be helpful if you produced a tiny program that reproduced your issue, so we can verify it's not something wrong in your code.
I finally got this to work. There was a problem with the shaders i was using. /facepalm