On 20/11/2013 at 15:40, xxxxxxxx wrote:
Cinema 4D Version: 15
Platform: Windows ;
Language(s) : C++ ;
well I'm trying to make a CUDA plugin , till now everything is fine , just one main problem is that performance is CRIPPLED due to copy (cpu -> gpu) then (gpu -> cpu) then (cpu -> c4d opengl) ...
seems really ugly thing :( (performance can go from 10 fps to 300 fps if I can take any handle to GPU)
now the 2 questions are (if any one can solve any or give hints will be appreciated :) ) :
1 - in gl_test_object.cpp , this line exactly:
m_pSubBuffer = pBuffer->AllocSubBuffer(bd, VBArrayBuffer, lPoints * (sizeof(float3) + sizeof(float3) + sizeof(float3)), void* pData);
that *pData , how to give it directly to the function without having to do map buffer , copy stuff , unmap buffer? , I tried the naive method of copy stuff to the pointer , and pass it , but C4D crashes..
2 - in vbstereo.cpp , I see that the drawn frame can be controlled directly from the textures:
nTexture1 = fbuf->GetTexture(colortex, C4D_FRAMEBUFFER_COLOR); nTexture2 = fbuf->GetTexture(colortex + 1, C4D_FRAMEBUFFER_COLOR); nTexture3 = lCameraCount == 3 ? fbuf->GetTexture(colortex + 2, C4D_FRAMEBUFFER_COLOR) : 0;
can I use something like this in the other VBO file to directly draw the vertex buffer? (as till now THIS is the only function that returns a HANDLE to something on GPU .... I can for example use that Handle directly in CUDA and modify its data)
thanks in advance , and hope some one can help