Re: [PyOpenGL-Users] Using framebuffers
Brought to you by:
mcfletch
From: Uğur G. <ugu...@gm...> - 2016-05-28 17:10:54
|
Thanks for your response and sharing your code! I started looking at your code. You are using from OpenGL.GL.EXT extensions by importing from OpenGL.GL.EXT.framebuffer_object import * I don't know what GL extensions are for in pyopengl, however, I tried to move from non-extension version to EXT versions of GL functions. Unfortunately, just at the beginning, calling the glGenFramebuffersEXT via fbo = glGenFramebuffersEXT(1) generates this error: OpenGL.error.NullFunctionError: Attempt to call an undefined function glGenFramebuffersEXT, check for bool(glGenFramebuffersEXT) before calling Also bool(glGenFramebuffersEXT) return False, whereas bool(glGenFramebuffers) is True. I am using GLFW to generate the window, and my opengl version on OSX is 4.1. You are using pygame for that purpose. Do you think that might be the source of my problem? I wasn't able to "pip install pygame" to install pygame, hence I am hesitant to use it. But I'll try glut and other window generation options to see whether framebuffer's work in them, or whether EXT functions can be called. Does this make sense? PS: By the way, I saw your amazing explanation on why y-axis should mean upwards direction on your website: "Part of the problem was that Blender, like many other modeling softwares use z for up, which is morally wrong (TL;DR: If y is "up" in 2D (clue: it is), then it should also be "up" in 3D; it's demented to redefine it to mean something literally orthogonal to its original meaning when you simply add a new coordinate)" Even though, as a physicist, I am in the "z is up" camp, I appreciated the persuasion power and simplicity of your argument. Also, my girlfriend agrees with you. :-) Have a good day! u On Fri, May 27, 2016 at 8:44 PM, Ian Mallett <ia...@ge...> wrote: > On Fri, May 27, 2016 at 5:35 PM, Uğur Güney <ugu...@gm...> wrote: > >> I am a beginner who studies OpenGL using PyOpenGL. I want to learn >> post-processing effects and as the first step I want to be able to render a >> scene into a FBO and then render that FBO on a quad that cover the whole >> screen. >> >> The python code I am running is this: >> https://gist.github.com/vug/2c7953d5fdf750c727af249ded3e9018 I combined >> parts from several tutorials I found on the internet. >> > > >> I appreciate if anyone can direct me on how to render on an offscreen >> framebuffer via PyOpenGL. >> > > As another reference, you may like to consider some of my code. For > example, I wrote a Game of Life simulator > <http://geometrian.com/programming/projects/index.php?project=Game%20of%20Life> > that uses FBOs (it actually uses two IIRC; feedback requires ping-ponging). > The code is well-abstracted and reasonably well-tested, so it should serve > as a good example. > > Ian > |