<div dir="ltr">I have solved the problem (and updated the GitHub Gist). This is what my QVTKFrameBufferObjectRenderer::render() method looks like now:<div><br></div><div><div><font face="courier new, monospace"> // Fix for differences in GL state between first call (before first</font></div>
<div><font face="courier new, monospace"> // rendering of the Qt Quick 2 Scene Graph) and second call. In order</font></div><div><font face="courier new, monospace"> // of most important to least.</font></div><div>
<font face="courier new, monospace"> glUseProgram(0); // crucial for the cone to show up at all after the first render</font></div><div><font face="courier new, monospace"> glDisable(GL_DEPTH_TEST); // depth buffer fighting between the cone and the background without this</font></div>
<div><font face="courier new, monospace"> glDisable(GL_BLEND); // doesn't seem crucial (?) but it is one of the differences that showed up in apitrace analysis</font></div><div><br></div><div> this->Render(); // vtkXOpenGLRenderWindow renders the scene to the FBO</div>
</div><div><br></div><div>But I'd still like to know the more robust, high level, elegant VTK way to do this.</div><div><br></div><div>Taylor<br><div><br></div><div><br></div></div></div><div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Tue, May 20, 2014 at 11:15 AM, Taylor Braun-Jones <span dir="ltr"><<a href="mailto:taylor@braun-jones.org" target="_blank">taylor@braun-jones.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hello vtkusers,<div><br></div><div><div>I'm working on integrating VTK in into the Qt Quick Scene Graph using an FBO approach. <br></div></div><div><br></div><div><div>I currently have something that is close, but not quite there - the first frame rendered to the FBO by VTK works as expected - the VTK rendered scene shows up in the Qt Quick window with correct layering and Qt Quick Item properties and animations work like any other Qt Quick component. Great! But then... the second time the Qt Scene graph requests VTK to render to the FBO nothing shows up.</div>
<div><br></div><div>Here is my minimal example to demonstrate the problem I'm having:</div><div><br></div><div><a href="https://gist.github.com/nocnokneo/c3fb01bb7ecaf437f7d6" target="_blank">https://gist.github.com/nocnokneo/c3fb01bb7ecaf437f7d6</a></div>
<div><br></div><div>It includes a README.md with some simple build instructions. To trigger a second VTK-render-to-FBO, you can resize the window by one pixel (or uncomment the update() call at line 64 of QVTKFrameBufferObjectItem.cpp)</div>
<div><br></div></div><div>Thanks in advance for any pointers or suggestions!</div><div><br></div><div>Taylor</div><div><br></div><div>PS - Here are some links to provide more context and information:</div><div><br></div>
<div>
<div>Relevant Qt Quick 2 Docs</div><div><a href="http://qt-project.org/doc/qt-5/qquickframebufferobject.html" target="_blank">http://qt-project.org/doc/qt-5/qquickframebufferobject.html</a></div><div><a href="http://qt-project.org/doc/qt-5/qsgsimpletexturenode.html" target="_blank">http://qt-project.org/doc/qt-5/qsgsimpletexturenode.html</a></div>
<div><a href="http://qt-project.org/doc/qt-5/qtquick-visualcanvas-scenegraph-renderer.html" target="_blank">http://qt-project.org/doc/qt-5/qtquick-visualcanvas-scenegraph-renderer.html</a></div><div><br></div><div>Presentation by James Turner at Qt Developer Days<br>
</div><div><a href="http://www.qtdeveloperdays.com/sites/default/files/presentation_pdf/james-turner-devdays-2013-talk.pdf" target="_blank">http://www.qtdeveloperdays.com/sites/default/files/presentation_pdf/james-turner-devdays-2013-talk.pdf</a> (video: <a href="https://www.youtube.com/watch?v=BfIaTccy6HQ" target="_blank">https://www.youtube.com/watch?v=BfIaTccy6HQ</a>)</div>
<div><br></div><div>Qt's example of what I'm trying to do except using "raw" OpenGL instead of VTK and not using the QQuickFramebufferObject convenience class:<br></div><div><a href="http://qt-project.org/doc/qt-5/qtquick-scenegraph-textureinsgnode-example.html" target="_blank">http://qt-project.org/doc/qt-5/qtquick-scenegraph-textureinsgnode-example.html</a></div>
</div><div><br></div></div>
</blockquote></div><br></div>