PDA

View Full Version : getViewportDib


Celarien
05-21-2008, 06:19 AM
I currently use gw.getViewportDib() to capture, at each instant, the images of two viewports.
To do this I must set one viewport as active, capture it, set the second one and capture it too. I want to do this in real time and be able to move the scene around, the problem is that setting the active viewport is the mostly costly commands in this process.

It there any way to contour this? Anything like (I know it doesnt work, but just an example) gw.getViewportDib(1) for viewport 1?

Thanks in advance,
Peter.

ZeBoxx2
05-21-2008, 12:22 PM
'fraid not

But I wonder why it is such a costly command - is it redrawing the viewports when you do so, perhaps? If so - Could you disable viewport redrawing, take both shots, then restore viewport redrawing?

Celarien
05-26-2008, 08:21 PM
I've tried that, but I've based the script on the vertex renderer ("how to..."), and it updates the image whenever the viewports are redrawn. So if I disable it, it won't update the image. Are there any other callbacks that will be activated when the time slider is changed or anything in the scene is changed?

I also don't know why it's so costly, but test it... It is very slow if you set it to change active viewports every instant they are redrawn. I've tested in several ways and the most expensive part of my script are the two setActiveViewport commands I use.

CGTalk Moderation
05-26-2008, 08:21 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.