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

    VPBuffer is not updated [SOLVED]

    SDK Help
    0
    2
    183
    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 22/12/2016 at 12:26, xxxxxxxx wrote:

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

      ---------
      Hello.

      I try to support my render engine in C4D's IRR.
      The problem I'm trying to deal with is that the buffer is not updated as soon as I write to it.

      The following code runs in VIDEOPOSTCALL_RENDER pass in close step.

      VPBuffer color_buffer = render->GetBuffer(VPBUFFER_RGBA, 0);
      bool test_break = vps->thread->TestBreak();
      while ( !test_break ) { 
      	//check if render engine has updated its image
      	//if it has, get the image from the render engine and fill color_buffer using SetLine.
      	//repeat until the thread breaks
      	test_break = vps->thread->TestBreak();
      }
        
      return RENDERRESULT_USERBREAK;
      

      Even though the color buffer is filled correctly, it is not updated in the viewport unless 
      the thread breaks and the whole VIDEOPOSTCALL pipeline has to run again.
      I break the thread by clicking the mouse in the viewport.

      The reason why I use the above code in a while loop is because the render engine keeps updating its image, so I have to update C4D buffer as well.

      Thank you for your time.

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

        On 27/12/2016 at 07:12, xxxxxxxx wrote:

        Hi Peterakos, thanks for  writing us.

        With reference to your question, IRR has been designed to provide interactive rendering functionality by using a non-progressive rendering engine. Under this scenario it's not required to update the region frequently as the framebuffer gets updated but only when the rendering engine has finally completed its task or the user interacts with the scene.

        Alternatively you can investigate the option to implement a GeDialog with a GeUserArea responsible to show the progressively refined framebuffer via its DrawBitmap() method.

        Best, Riccardo.

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