From: Carsten N. <car...@gm...> - 2010-09-20 15:04:34
|
Hello Johannes, On 09/20/2010 03:12 AM, Johannes Brunen wrote: > "Carsten Neumann"<car...@gm...> schrieb im > Newsbeitrag news:4C9...@gm...... >> >> there is a colBuf->setReadBack(true) missing, you already enable post >> processing on the fbo, but not the actual read back of the color buffer. >> > I think that this statement is not missing. See in line 260: > > fbo->getColorAttachments(0)->setReadBack(true); yes, sorry I'm blind, for some reason I was only looking for a line that started with colBuf... Running the program I get warnings: WARNING: Viewport::render: no background! these can be fixed by adding: stage_viewport->setBackground(vp0->getBackground()); stage_viewport->setCamera (vp0->getCamera()); I'm turning the warnings into FATAL messages, because a missing camera, background or root node will prevent rendering the viewport. Fixing that, I get an OpenGL error about the FBO being incomplete, the reason being that the color attachment is created without specifying a valid internal format (RenderBuffer does not try to take the value from the image if it is present and its own internal format field is GL_NONE - I'm preparing a patch for that). For now, adding: colBuf->setInternalFormat(GL_RGBA); does the trick. Finally I've moved the line: win->addPort(stage_viewport); After the loop over all viewports, because it seemed like you only want to iterate over previously existing viewports. With those changes (modified file is attached) the image is not all black any more, however there is something wrong with the tiling (I get 9 copies of the torus instead of one big one) and it is unlit (because the light source is part of the internal nodes the SSM places on top of the user provided scene and therefore is not included when rendering only the user provided scene into the FBO). Cheers, Carsten |