Framebuffer error (problem with npot extents)

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
pekka
Party member
Posts: 206
Joined: Thu Jan 07, 2010 6:48 am
Location: Oulu, Finland
Contact:

Framebuffer error (problem with npot extents)

Post by pekka »

EDIT: I believe that using framebuffers with extents that are not power of two can fail. It will result in an error that tells you to inform love devs. However, you should not inform them, but just use pot2 framebuffers for maximum portability.

I will need to test this further to be sure. This is what it looks like now based on what happened on my computer.

Request: If you have a computer that doesn't support npot2 images, try creating framebuffers of different sizes on it. Report any errors you get here.

end EDIT

Trying to create a framebuffer on my Linux computer without proper driver support for the card results in this:

Code: Select all

Error: [string "main.lua"]:1: Cannot create Framebuffer: Error in implementation (please inform the love devs)
The error it gives is the value defined for this constant: GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT . I checked this by making the Löve code print out the error code.

This is the beginning of glxinfo printout:

Code: Select all

name of display: :0.0
display: :0  screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.2
server glx extensions:
    GLX_ARB_multisample, GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, 
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer, 
    GLX_OML_swap_method, GLX_SGI_make_current_read, GLX_SGI_swap_control, 
    GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, 
    GLX_SGIX_visual_select_group
client glx vendor string: Mesa Project and SGI
client glx version string: 1.4
client glx extensions:
    GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context, 
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_allocate_memory, 
    GLX_MESA_copy_sub_buffer, GLX_MESA_swap_control, 
    GLX_MESA_swap_frame_usage, GLX_OML_swap_method, GLX_OML_sync_control, 
    GLX_SGI_make_current_read, GLX_SGI_swap_control, GLX_SGI_video_sync, 
    GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, 
    GLX_SGIX_visual_select_group, GLX_EXT_texture_from_pixmap
GLX version: 1.2
GLX extensions:
    GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context, 
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer, 
    GLX_MESA_swap_frame_usage, GLX_OML_swap_method, GLX_SGI_make_current_read, 
    GLX_SGI_video_sync, GLX_SGIS_multisample, GLX_SGIX_fbconfig, 
    GLX_SGIX_pbuffer, GLX_SGIX_visual_select_group, 
    GLX_EXT_texture_from_pixmap
OpenGL vendor string: DRI R300 Project
OpenGL renderer string: Mesa DRI R300 (RV380 3150) 20090101  TCL DRI2
OpenGL version string: 1.5 Mesa 7.7.1
OpenGL extensions:
    GL_EXT_compiled_vertex_array, GL_EXT_texture_env_add, 
    GL_ARB_depth_texture, GL_ARB_draw_buffers, GL_ARB_fragment_program, 
    GL_ARB_imaging, GL_ARB_multisample, GL_ARB_multitexture, 
    GL_ARB_occlusion_query, GL_ARB_point_parameters, GL_ARB_provoking_vertex, 
    GL_ARB_shadow, GL_ARB_shadow_ambient, GL_ARB_texture_border_clamp, 
    GL_ARB_texture_compression, GL_ARB_texture_cube_map, 
    GL_ARB_texture_env_add, GL_ARB_texture_env_combine, 
    GL_ARB_texture_env_crossbar, GL_ARB_texture_env_dot3, 
    GL_MESAX_texture_float, GL_ARB_texture_mirrored_repeat, 
    GL_ARB_texture_rectangle, GL_ARB_transpose_matrix, 
    GL_ARB_vertex_array_bgra, GL_ARB_vertex_buffer_object, 
    GL_ARB_vertex_program, GL_ARB_window_pos, GL_EXT_abgr, GL_EXT_bgra, 
    GL_EXT_blend_color, GL_EXT_blend_equation_separate, 
    GL_EXT_blend_func_separate, GL_EXT_blend_logic_op, GL_EXT_blend_minmax, 
    GL_EXT_blend_subtract, GL_EXT_convolution, GL_EXT_copy_texture, 
    GL_EXT_draw_range_elements, GL_EXT_framebuffer_blit, 
    GL_EXT_framebuffer_object, GL_EXT_fog_coord, 
    GL_EXT_gpu_program_parameters, GL_EXT_histogram, GL_EXT_multi_draw_arrays, 
    GL_EXT_packed_depth_stencil, GL_EXT_packed_pixels, 
    GL_EXT_point_parameters, GL_EXT_polygon_offset, GL_EXT_provoking_vertex, 
    GL_EXT_rescale_normal, GL_EXT_secondary_color, 
    GL_EXT_separate_specular_color, GL_EXT_shadow_funcs, 
    GL_EXT_stencil_two_side, GL_EXT_stencil_wrap, GL_EXT_subtexture, 
    GL_EXT_texture, GL_EXT_texture3D, GL_EXT_texture_cube_map, 
    GL_EXT_texture_edge_clamp, GL_EXT_texture_env_combine, 
    GL_EXT_texture_env_dot3, GL_EXT_texture_filter_anisotropic, 
    GL_EXT_texture_lod_bias, GL_EXT_texture_mirror_clamp, 
    GL_EXT_texture_object, GL_EXT_texture_rectangle, GL_EXT_texture_sRGB, 
    GL_EXT_vertex_array, GL_EXT_vertex_array_bgra, GL_APPLE_packed_pixels, 
    GL_ATI_blend_equation_separate, GL_ATI_texture_env_combine3, 
    GL_ATI_texture_mirror_once, GL_ATI_separate_stencil, 
    GL_IBM_multimode_draw_arrays, GL_IBM_rasterpos_clip, 
    GL_IBM_texture_mirrored_repeat, GL_INGR_blend_func_separate, 
    GL_MESA_pack_invert, GL_MESA_ycbcr_texture, GL_MESA_window_pos, 
    GL_NV_blend_square, GL_NV_light_max_exponent, GL_NV_packed_depth_stencil, 
    GL_NV_texture_rectangle, GL_NV_texgen_reflection, GL_NV_vertex_program, 
    GL_OES_read_format, GL_SGI_color_matrix, GL_SGI_color_table, 
    GL_SGIS_generate_mipmap, GL_SGIS_texture_border_clamp, 
    GL_SGIS_texture_edge_clamp, GL_SGIS_texture_lod, GL_SUN_multi_draw_arrays
I'm not expecting OpenGL stuff to work so great on Linux with this computer, because I really don't have the compatible drivers. I'm only posting this because it said to inform the devs.

I have better OpenGL support elsewhere.
Last edited by pekka on Mon Sep 20, 2010 5:31 am, edited 3 times in total.
User avatar
vrld
Party member
Posts: 917
Joined: Sun Apr 04, 2010 9:14 pm
Location: Germany
Contact:

Re: Framebuffer error

Post by vrld »

pekka wrote:... without proper driver support ...
I think that is the problem here. Mesa (software opengl implementation) reports support for framebuffer objects (GL_EXT_framebuffer_object), when in fact it does not.

... Or, it could be that you are out of memory. How big is the framebuffer you are trying to create?
I have come here to chew bubblegum and kick ass... and I'm all out of bubblegum.

hump | HC | SUIT | moonshine
pekka
Party member
Posts: 206
Joined: Thu Jan 07, 2010 6:48 am
Location: Oulu, Finland
Contact:

Re: Framebuffer error

Post by pekka »

It does look like Mesa is reporting the support wrong, because any code I've tested fails to attach the texture or renderbuffer correctly. Do you have any source for the state of framebuffer support in Mesa?
User avatar
vrld
Party member
Posts: 917
Joined: Sun Apr 04, 2010 9:14 pm
Location: Germany
Contact:

Re: Framebuffer error

Post by vrld »

pekka wrote:Do you have any source for the state of framebuffer support in Mesa?
Framebuffer objects are in OpenGL core with version 2.0. With previous versions, you can still have framebuffer objects with a so called extension. The one you need for basic support is GL_EXT_framebuffer_object.
Your MESA driver reports to implement OpenGL 1.4, so the code looks for the extension, which MESA also boasts to support. But apparently it doesn't. Instead it returns weird and misleading error messages. I have the same problem with love-glsl and a card without shader support... :x
Said graphics card supports framebuffers though, so there are cases in which MESA reports support correctly, sort of :ehem:
I'm not really sure how to fix this, since there is no way to know which error message will be returned or how to distinguish them from real error messages.
I have come here to chew bubblegum and kick ass... and I'm all out of bubblegum.

hump | HC | SUIT | moonshine
pekka
Party member
Posts: 206
Joined: Thu Jan 07, 2010 6:48 am
Location: Oulu, Finland
Contact:

Re: Framebuffer error

Post by pekka »

This works. Or at least it does not raise an error immediately.

Code: Select all

love.graphics.newFramebuffer(128,128)
I think the issue is that my card does not support npot2 textures on Linux. Hence the attempt to create framebuffers of size 800 x 600 and 300 x 300, which I tried previously, failed.

For maximum portability, you should use framebuffers that have extents that are powers of two. Just like you want to use images of that size when you care about people with old cards or poor drivers.

(I have a better driver for the card when I boot to Windows. There I can use npot2 textures and shader programs and so on. It goes from OpenGL 1.5 to 2.1...)
User avatar
vrld
Party member
Posts: 917
Joined: Sun Apr 04, 2010 9:14 pm
Location: Germany
Contact:

Re: Framebuffer error (problem with npot2 extents)

Post by vrld »

I think you have discovered a way to check whether one suffers from the PO2 syndrome or not.
I have come here to chew bubblegum and kick ass... and I'm all out of bubblegum.

hump | HC | SUIT | moonshine
pekka
Party member
Posts: 206
Joined: Thu Jan 07, 2010 6:48 am
Location: Oulu, Finland
Contact:

Re: Framebuffer error (problem with npot2 extents)

Post by pekka »

Not so fast. Trying to create a npot2 framebuffer still failed on Windows, where I can happily use npot2 textures.

I dunno why...
pekka
Party member
Posts: 206
Joined: Thu Jan 07, 2010 6:48 am
Location: Oulu, Finland
Contact:

Re: Framebuffer error (problem with npot extents)

Post by pekka »

If anybody was wondering what npot2 stood for, I will tell you now that it is a common term of ballet aficionados. It stands for "nasty power of tutu." I removed the 2 from the title of this thread because ballet is scary and not a fitting topic in this fine forum. I will use npot fro m now on, and try to remember that is stands for "no, please only [powers of] two!!"

For the brave souls: http://en.wikipedia.org/wiki/Ballet_tutu

It was my mistake mixing ballet and Löve, two things that have little to do with each other :o
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 204 guests