|
|
| [a5] filtering primitives for offscreen bitmaps? |
|
Mark Oates
Member #1,146
March 2001
|
Hey again. When drawing primitives to a bitmap other than the backbuffer, the multisampling fails. In this example, I've drawn a line to the backbuffer (on the left), and also drawn it to an offscreen bitmap (right) 1ALLEGRO_BITMAP *offscreen_render;
2
3// initialize code
4
5offscreen_render = al_create_bitmap(200, 150);
6
7// in the draw code
8
9 al_set_target_bitmap(offscreen_render);
10 al_clear_to_color(color("light green"));
11 al_draw_line(10, 120, 190, 100, color("red"), 3);
12
13 al_set_target_bitmap(al_get_backbuffer());
14 al_draw_line(10, 120, 190, 100, color("red"), 3);
15
16 al_draw_bitmap(offscreen_render, 200, NULL);
Produces: I tried adding the al_set_new_bitmap_flags(ALLEGRO_VIDEO_BITMAP) before creating the bitmap to be sure, but it didn't change anything. My idea for a workaround is to prerender onto the backbuffer and draw from there to intended prerender location. This doesn't seem ideal but it could work. [edit] oops, topic should be "[a5] multisampling primitives for offscreen bitmaps?" [edit] I've tried drawing with the backbuffer to another surface but it won't permit it. The console outputs 'fail'. -- |
|
Elias
Member #358
May 2000
|
Yes, multi-sampling is only supported on the display backbuffer so far (with OpenGL at least). I wouldn't know how to enable multi-sampling for an FBO. If there's some simple OpenGL setting for it we should enable it. Otherwise, need a patch to implement it. Do you know if it works with DirectX? -- |
|
Milan Mimica
Member #3,877
September 2003
|
EXT_framebuffer_multisample looks like it.
-- |
|
Elias
Member #358
May 2000
|
Quote: No method is provided for creating multisample texture images. Since we only support drawing into bitmaps (textures) and have no actual "off-screen" buffers, does this mean we cannot use it? -- |
|
Mark Oates
Member #1,146
March 2001
|
Elias said: Do you know if it works with DirectX? No. It does not work with DirectX. -- |
|
|