【问题标题】:OpenGL PyOpenGL Framebuffer object not working: glGenFramebuffers missingOpenGL PyOpenGL 帧缓冲区对象不工作:glGenFramebuffers 丢失
【发布时间】:2014-05-28 10:49:40
【问题描述】:

我有两个系统,OpenGL 版本和扩展支持看似相同,但 Framebuffers 似乎没有在其中一个上工作。

带有Intel HD 4000 Graphics Card的系统。(FRAMEBUFFER WORKS HERE) 这是glxinfo | grep OpenGL的输出:

OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Ivybridge Mobile 
OpenGL core profile version string: 3.3 (Core Profile) Mesa 10.1.0
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 10.1.0
OpenGL shading language version string: 1.30

这是glxinfo | grep framebuffer的输出:

GLX_ARB_framebuffer_sRGB, GLX_ARB_multisample, 
GLX_EXT_create_context_es2_profile, GLX_EXT_framebuffer_sRGB, 
GLX_ARB_framebuffer_sRGB, GLX_ARB_get_proc_address, GLX_ARB_multisample, 
GLX_EXT_framebuffer_sRGB, GLX_EXT_import_context, 
GLX_ARB_framebuffer_sRGB, GLX_ARB_get_proc_address, GLX_ARB_multisample, 
GLX_EXT_create_context_es2_profile, GLX_EXT_framebuffer_sRGB, 
GL_ARB_fragment_shader, **GL_ARB_framebuffer_object**, 
GL_ARB_framebuffer_sRGB, GL_ARB_get_program_binary, 
GL_EXT_draw_instanced, GL_EXT_framebuffer_blit, 
GL_EXT_framebuffer_multisample, GL_EXT_framebuffer_multisample_blit_scaled, 
GL_EXT_framebuffer_sRGB, GL_EXT_packed_depth_stencil, GL_EXT_packed_float, 
GL_ARB_fragment_shader, GL_ARB_framebuffer_object, 
GL_ARB_framebuffer_sRGB, GL_ARB_get_program_binary, 
GL_EXT_framebuffer_blit, GL_EXT_framebuffer_multisample, 
GL_EXT_framebuffer_multisample_blit_scaled, GL_EXT_framebuffer_object, 
GL_EXT_framebuffer_sRGB, GL_EXT_gpu_program_parameters,

这是另一个系统,其中Framebuffer 正在生成。

glxinfo | grep OpenGL的输出:

OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Ivybridge Mobile 
OpenGL core profile version string: 3.3 (Core Profile) Mesa 10.3.0-devel (git-ecee4c4 saucy-oibaf-ppa)
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 10.3.0-devel (git-ecee4c4 saucy-oibaf-ppa)
OpenGL shading language version string: 1.30

glxinfo | grep framebuffer的输出:

GLX_ARB_framebuffer_sRGB, GLX_ARB_get_proc_address, GLX_ARB_multisample, 
GLX_EXT_fbconfig_packed_float, GLX_EXT_framebuffer_sRGB, 
**GL_ARB_framebuffer_object**, GL_ARB_framebuffer_sRGB, 
GL_EXT_draw_instanced, GL_EXT_framebuffer_blit, 
GL_EXT_framebuffer_multisample, GL_EXT_framebuffer_multisample_blit_scaled, 
GL_EXT_framebuffer_sRGB, GL_EXT_packed_depth_stencil, GL_EXT_packed_float, 
GL_ARB_fragment_shader, GL_ARB_framebuffer_object, 
GL_ARB_framebuffer_sRGB, GL_ARB_get_program_binary, 
GL_EXT_framebuffer_blit, GL_EXT_framebuffer_multisample, 
GL_EXT_framebuffer_multisample_blit_scaled, GL_EXT_framebuffer_object, 
GL_EXT_framebuffer_sRGB, GL_EXT_gpu_program_parameters, 

GL_ARB_framebuffer_object 是支持FramebufferOpenGL 的扩展。两个系统都有,但仍然有一个不工作。

我使用Python (PyOpenGL) 并使用以下函数来检查使用print dir(OpenGL.GL) 存在的所有函数并将输出保存到文件中。我惊讶地发现,尽管存在 Framebuffer 扩展,但函数 glGenFramebuffers 不见了。

这可能是什么问题?

【问题讨论】:

  • 参见 问题 (8) here “与大多数 ARB 扩展不同,这是已在 OpenGL 中批准的功能的严格子集3.0。此扩展仅用于支持无法实现完整 OpenGL 3.0 驱动程序的旧硬件上的该功能。” GL_ARB_framebuffer_object 没有做您认为的事情,GL 3.0 实现已经保证了此功能和 FBO扩展不会改变任何东西。您检查该扩展的唯一原因是您没有 3.0 实现。
  • 现在,至于你的实际问题......而不是打印glxinfo 的输出,你有没有机会在你的 GL 程序运行时检查这些东西?您可能会选择一种像素格式,让您在其中一个硬件上脱离 GL 3.0 路径。
  • @AndonM.Coleman 这只是在其他一些很奇怪的模块中。

标签: opengl gpu framebuffer pyopengl


【解决方案1】:

Python 2.7.5+ 上,Framebuffer 对象在单独的模块中可用。

模块为:OpenGL.GL.framebufferobjects

而在Python 2.7.6 及更高版本上,它可以直接在内部使用:OpenGL.GL

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-06-26
    • 2010-10-19
    • 1970-01-01
    相关资源
    最近更新 更多