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

    update render buffer directly from GPU

    SDK Help
    0
    3
    249
    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 28/10/2014 at 12:26, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   13+ 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      how can I get the GPU buffer pointer, so I can update it directly from my CUDA renderer, instead of copying GPU->CPU->GPU

      what I see from VPInvertImage example, it updates the rgba buffer line by line:

      rgba->GetLine(x1, y, cnt, buffer, 32, true);
      ...
      rgba->SetLine(x1, y, cnt, buffer, 32, true);

      if I can't access the GPU buffer, is there a way to create another OpenGL frame buffer and update to it? "any SDK example to look at would be appreciated"

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

        On 29/10/2014 at 03:23, xxxxxxxx wrote:

        Hello,

        Why do you want to write to a GPU buffer?

        A Renderer (like any other Videopost) writes it's results into a framebuffer that is stored in the ordinary RAM. Depending on what are you doing Cinema will take this framebuffer and display it in the Viewport, the Picture Viewer or save it to a file. If you are using RenderDocument()[URL-REMOVED] you can do whatever you like with the render result in the used BaseBitmap.

        The InvertImage example Videopost does not edit any GPU buffer. It's Execute()[URL-REMOVED] function is called for rendering the final frame (on CPU). The extended OpenGL preview is manged by GlDraw()[URL-REMOVED]. This function adds a custom shader to the BaseDraw. But these functions are not documented.

        You may be able to create another OGL framebuffer but that has nothing to do anymore with the Cinema SDK.

        best wishes,
        Sebastian


        [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

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

          On 30/10/2014 at 07:42, xxxxxxxx wrote:

          Hi Sebastian,

          thanks for clarification, my Renderer got 2 engines, one which uses CPU "so writing and displaying results in a similar way to InvertImage example" , and another engine which uses GPU (CUDA) , displaying progressive data using CUDA will make lots of copying between CPU/GPU memory which is not needed in that case "although the final result must be saved to CPU as you know"

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