Render into picture viewer without VolumeData
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 26/01/2012 at 03:15, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 13
Platform: Windows ; Mac OSX ;
Language(s) : C++ ;---------
Hi all,As far as I know it's is possible to create a VideoPostData that is an external renderer and calls VolumeData::SkipRenderingProcess() in VideoPostData::Execute() at the stages VIDEOPOSTCALL_RENDER and VIDEOPOSTCALL_INNER. I have done some experiments and everything seems to work as advertised.
Unfortunately then, the C4D renderer has already created a duplicate of the document and built a VolumeData including the render geometry and acceleration structures. As I don't need that data it just uses up memory.
-> Is there a way to be able to render using the picture viewer, but without the creation of the render geometry?
Many thanks in advance. Cheers,
Marcus -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 26/01/2012 at 03:33, xxxxxxxx wrote:
The docs say this:
VIDEOPOSTCALL_RENDER - Render precalculation. VolumeData not yet completly accessible.
My interpretation is that if SkipRenderProcess() is called at VIDEOPOSTCALL_RENDER, this will prevent the VolumeData from being built. I'm relying on that behaviour for one of my plugins, but maybe I should check this again :-).
Best regards
/Filip -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 26/01/2012 at 16:44, xxxxxxxx wrote:
Thanks for the reply. That's what I thought first, too. But it shows, that the memory consumpton goes up quite a bit. So I had a closer look:
VolumeData::GetObjCount() already returns the correct number of objects, accumulating the polygon count, also returns the total number and you can even do ray intersection tests.
I think the only thing that is not done is the setup of the shaders, but I may be wrong here, too.
Cheers,
Marcus -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 26/01/2012 at 21:33, xxxxxxxx wrote:
Ok, I can answer my question myself: The code below "renders" a checker board into the picture viewer without creating a VolumeData.
By the way, the document pointed to by "vps->doc" is a copy of the scene document.
Cheers,
MarcusRENDERRESULT ExternalRenderer::Execute(BaseVideoPost* node, VideoPostStruct* vps) { if (vps && vps->render) { Render* render = vps->render; VPBuffer* buffer= render->GetBuffer(VPBUFFER_RGBA, 0); LONG width = buffer->GetBw(); LONG height = buffer->GetBh(); SReal *lineBuffer = bNew SReal[width * 4]; for (LONG row = 0; row < height; ++row) { if (row % 10 == 0) { for (LONG col = 0; col < width; ++col) { if (((row / 10) & 1) ^ ((col / 10) & 1)) { lineBuffer[col*4] = 0.55; lineBuffer[col*4+1] = 0.55; lineBuffer[col*4+2] = 0.55; lineBuffer[col*4+3] = 0.55; } else { lineBuffer[col*4] = 0.45; lineBuffer[col*4+1] = 0.45; lineBuffer[col*4+2] = 0.45; lineBuffer[col*4+3] = 0.45; } } } buffer->SetLine(0, row, width, lineBuffer, 32, false); GeSleep(10); } bDelete(lineBuffer); return RENDERRESULT_USERBREAK; } return RENDERRESULT_OK; }
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 27/01/2012 at 01:24, xxxxxxxx wrote:
Unfortunately animation rendering doesn't relly work with this method since we stop during the first frame. -> All the nice animation functionality of the picture viewer becomes unavailable
If someone knows a better way, please let me know.
Thanks,
Marcus