idlgrbuffer draw :create_instance and draw_instance question.... [message #80858] |
Thu, 19 July 2012 15:07  |
George Millward
Messages: 29 Registered: February 2000
|
Junior Member |
|
|
Hi there,
I have an object graphics code that writes .png files offline (runs under cron). So I use the idlgrbuffer instead of drawing to a window. Anyhow, I have noticed that the drawing to the buffer is quite computationally intense so I've been trying to speed things up.
I see the 'create_instance' and 'draw_instance' keywords in the draw method. These seem to have something to do with rendering the parts of an image which are unchanged separately from the changing part....but the help documentation is somewhat terse.
Can anyone explain what this does - any examples ?
Any other tips for speeding up rendering to an idlgrbuffer object ?
Cheers
George.
|
|
|
Re: idlgrbuffer draw :create_instance and draw_instance question.... [message #80914 is a reply to message #80858] |
Mon, 23 July 2012 15:43  |
George Millward
Messages: 29 Registered: February 2000
|
Junior Member |
|
|
On Monday, July 23, 2012 7:28:13 AM UTC-6, nata wrote:
> Hi George,
>
> I use the CREATE_INSTANCE and DRAW_INSTANCE a lot but not in the IDLgrBuffer. I use it in the IDLgrWindow These 2 keywords are very useful when you have a lot of graphical objects in your view and you don't need render all of them.
>
> What I do is separate the graphical objects in 2 models. One containing the static components (the objects that won't change) and another model containing the dynamic objects.
> The dynamic objects are those ones that change in time, position, color, etc. and you have to render all the time.
>
> Then, if you want to speed things up (and if I remember correctly), you can proceed that way :
>
> dynamic_model->SetProperty, /HIDE
> window->Draw, view, /CREATE_INSTANCE
>
> static_model->SetProperty, /HIDE
> view->SetProperty, /TRANSPARENT
> dynamic_model->SetProperty, HIDE=0
>
> After this, the command window->Draw, view, /DRAW_INSTANCE will only render the dynamic objects contained in the dynamic model and everything will be less computationally intense.
>
> Hope it will be useful to you !
> nata
Nata,
Very interesting - I'll give it a go and report back how this works with the idlgrbuffer.
Cheers
George.
|
|
|
Re: idlgrbuffer draw :create_instance and draw_instance question.... [message #80927 is a reply to message #80858] |
Mon, 23 July 2012 06:28  |
natha
Messages: 482 Registered: October 2007
|
Senior Member |
|
|
Hi George,
I use the CREATE_INSTANCE and DRAW_INSTANCE a lot but not in the IDLgrBuffer. I use it in the IDLgrWindow These 2 keywords are very useful when you have a lot of graphical objects in your view and you don't need render all of them.
What I do is separate the graphical objects in 2 models. One containing the static components (the objects that won't change) and another model containing the dynamic objects.
The dynamic objects are those ones that change in time, position, color, etc. and you have to render all the time.
Then, if you want to speed things up (and if I remember correctly), you can proceed that way :
dynamic_model->SetProperty, /HIDE
window->Draw, view, /CREATE_INSTANCE
static_model->SetProperty, /HIDE
view->SetProperty, /TRANSPARENT
dynamic_model->SetProperty, HIDE=0
After this, the command window->Draw, view, /DRAW_INSTANCE will only render the dynamic objects contained in the dynamic model and everything will be less computationally intense.
Hope it will be useful to you !
nata
|
|
|