On 22/12/2016 at 12:26, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R18
Platform: Windows ;
Language(s) : C++ ;
---------
Hello.
I try to support my render engine in C4D's IRR.
The problem I'm trying to deal with is that the buffer is not updated as soon as I write to it.
The following code runs in VIDEOPOSTCALL_RENDER pass in close step.
VPBuffer color_buffer = render->GetBuffer(VPBUFFER_RGBA, 0);
bool test_break = vps->thread->TestBreak();
while ( !test_break ) {
//check if render engine has updated its image
//if it has, get the image from the render engine and fill color_buffer using SetLine.
//repeat until the thread breaks
test_break = vps->thread->TestBreak();
}
return RENDERRESULT_USERBREAK;
Even though the color buffer is filled correctly, it is not updated in the viewport unless
the thread breaks and the whole VIDEOPOSTCALL pipeline has to run again.
I break the thread by clicking the mouse in the viewport.
The reason why I use the above code in a while loop is because the render engine keeps updating its image, so I have to update C4D buffer as well.
Thank you for your time.