[vtkusers] Hardware offscreen rendering (and its possible use for the Java wrappers)

Aashish Chaudhary aashish.chaudhary at kitware.com
Thu Oct 20 09:22:26 EDT 2011


Hi Luke,

Quickly looked over your email. Correct me if I am wrong but it seems
like you are looking for render to texture (+alternatives).

It is not hard, the tricky part is to handle variations in OpenGL
versions but it won't be that bad.  I have implemented two variations
of it earlier ( for OpenGL 3.3 (used for deferred shading) and OpenGL
ES (render to texture) ).

Best,

On Thu, Oct 20, 2011 at 8:19 AM, Sebastien Jourdain
<sebastien.jourdain at kitware.com> wrote:
> Hi Luke,
>
> I can agree and if you do the thing smartly you can use another
> dedicated thread for VTK than the EDT. But unfortunately, it doesn't
> seem that easy. I think that Karthik did try something like that and
> the performance were very poor.
> Moreover, we might run into multi-platform issue on the C++ layer in
> the way the OpenGL context get truly created.
>
> Karthik can you elaborate your experience in that domain if any ?
>
> Thanks,
>
> Seb
>
> On Wed, Oct 19, 2011 at 10:53 AM, Luke Dodd <luke.dodd at gmail.com> wrote:
>> Hi,
>>
>> It seems that hardware (NOT mesa) based offscreen rendering is not
>> supported in VTK. But the existence
>> vtkOpenGLRenderWindow::CreateHardwareOffScreenWindow method, and my
>> personal experience with using OpenGL frame buffers make me think it
>> really shouldn't be so hard to achieve. Of course the aforementioned
>> methods are protected so I'm not sure how or if I'm supposed to go
>> about using them (inheriting from vtkOpenGLRenderWindow doesn't seem
>> like something I'm supposed to do). Also I think if it were actually
>> easy to achieve then it would have already been done.
>>
>> The reason I'm thinking about this is that decent hardware offscreen
>> rendering I think it could be easy to implement a vtk panel in java
>> that uses offscreen rendering, and standard java 2D graphics API to
>> put that offscreen image onscreen. It sounds convoluted but it would
>> skip all the hassle with lightweight vs heavyweight components,
>> eliminate the need for the extra JNI code the vtkPanel currently uses,
>> and the vtkRenderWindow leaks that currently occur under Linux. I just
>> did a quick test, and it seems to me, that reading glReadPixels does
>> work fast enough for this to be possible unless one needs really high
>> frame rates.
>>
>> So I'm asking: is this possible with standard VTK? Would this be
>> possible with a few tweaks? Am I missing some great complication when
>> I think it shouldn't be hard to implement? And finally anyone else
>> interested in this?
>>
>> Best,
>> Luke Dodd
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



-- 
| Aashish Chaudhary
| R&D Engineer
| Kitware Inc.
| www.kitware.com



More information about the vtkusers mailing list