gl_test_object.cpp & vbstereo.cpp questions
-
On 20/11/2013 at 15:40, xxxxxxxx wrote:
User Information:
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
-
On 22/11/2013 at 13:05, xxxxxxxx wrote:
no body knows O_o at Maxon devs? sense like someone has just wrote the OpenGL calls for you and he just died "we can't support this OpenGL header , it is from another SDK.."
-
On 23/11/2013 at 03:53, xxxxxxxx wrote:
well nvm , I have solved my problem by hacking opengl buffer