Render to PV / Video Post plugin
-
Hi folks,
I've recently been doing some work on a multi-threaded draw plugin. I posted a topic here recently related to it: threading bitmaps.
I've been thinking I need to try make a video post plugin. It's not meant to be a render engine, it's just something I think I could use this way (i.e. use the render to picture viewer as a kind of display port). So I built a video post plugin. But, Execute() gets called multiple times, and while my draw does happen in the background, it also ends up rendering the current scene to the PV, which is of no use.
At this point, I've already built the draw to happen in a multi-threaded environment. So two queries:
-
how can I achieve a render to PV with live image update, without having to shift code from what I already have?
-
if I have to make a video post plugin as well (which would be handy so I could use the render to PV button shortcut), is it possible to prevent Cinema from drawing the current scene and just use my draw object that's already threaded?
Cheers,
WP.
-
-
What is a "draw plugin"?
A
VideoPostData
plugin is used to do two things: creating a video post (that does something with the rendered image), or implementing a render engine, that renders the scene.If you want Cinema to skip rendering the scene, you are creating a de-facto render engine.
Calling
RegisterVideoPostPlugin()
, you can setPLUGINFLAG_VIDEOPOST_ISRENDERER
to make that clear.You can call VolumeData::SkipRenderProcess() to tell Cinema not to render the scene; I'm not sure when the correct time is to call that. But you find some threads in this forum discussin that function.
-
hi,
sorry for the other thread, I'm trying to create an example and trying to do it the very right way.
About your question, you could probably check this thread
Let me know if that doesn't helped.Cheers,
Manuel -
Thanks folks,
PluginStudent - I missed the SkipRenderProcess() function, thanks for pointing that out, that takes care of one part
Manuel - no probs on the other thread, I know you guys are busy I'm still trying to nut out how I want this to work. But I'm looking at the code in the thread you linked to, and I've got it running in a VP plugin (with higher render passes to see the changes). It looks like Cinema takes care of updating the PV window, is that correct? If so, what initiates this update e.g. colorBuf->SetLine(), a timer, or a core message?
WP.
-
hi,
SetLine set the buffer (the bitmap) dirty.
The Pictures viewer use the Timer function, after some other checks, if the bitmap is dirty, it update the GeUserArea with the new data.Cheer,
Manuel -
@m_magalhaes Thanks, makes sense. Is this kind of dirty update inside all points that touch the pixel colours? E.g. does PixelPost also do this when setting col inside ExecutePixel()?
Just out of interest, what's a reasonable refresh rate for a timer with something like this? 200-500ms?
WP.
-
hi,
well, the picture viewer is a bit more complexe than just this timer. But it is set to 500ms if it's the benchmark and 350ms for internal render. But it doesn't hurt to lower the delay.
edit :
about pixelPost i'm not sure what you are talking about, there's no function there, only pointer.Cheers,
Manuel -
@m_magalhaes Sorry, I was a bit unclear on PixelPost, I need to stop working at night. I'll try this way - if I'm working at a pixel level, is SetLine() still the best way to do it?
Re timer, thanks for the thought. My dialog doesn't need to be realtime, 500 sounds like a good starting point.
WP
-
-
OK, I've managed to get the 'render' plugin going, I can see it drawing in the PV. A couple of followup queries:
-
can I update the PV progress bar manually?
-
how can I break the rendering in my custom threads when the 'stop rendering' button is pressed?
-
am I suppose to use GetDDescription() to draw the options in the render settings dialog (mine isn't showing anything)?
WP.
-
-
@WickedP said in Render to PV / Video Post plugin:
- can I update the PV progress bar manually?
You can set render process settings using
BASEBITMAP_DATA
parameters: BaseBitmap Manual.- am I suppose to use GetDDescription() to draw the options in the render settings dialog (mine isn't showing anything)?
You can use a standard parameter description resource as usual. You find a dozen examples in your installation or in the SDK examples.
-
@PluginStudent Thanks , progress bar sorted. For anyone reading, cast the vpBuffer into a Bitmap and use SetData().
Re GetDDescription(), I hard code my descriptions, but the function is never called. Any ideas?
WP.