Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    gl_test_object.cpp & vbstereo.cpp questions

    SDK Help
    0
    3
    287
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        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.."

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          On 23/11/2013 at 03:53, xxxxxxxx wrote:

          well nvm , I have solved my problem by hacking opengl buffer 🙂

          1 Reply Last reply Reply Quote 0
          • First post
            Last post