Announcement

Collapse
No announcement yet.

How to stop render after waitForRenderEnd

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to stop render after waitForRenderEnd

    hi,when I start with this:
    Code:
    mVRayRenderer->startSync();
    mVRayRenderer->waitForRenderEnd();
    then,before the rendering done,I want to stop the rendering,
    so I call:
    Code:
    mVRayRenderer->stop();
    but the rendering seems to get stuck and I can't end it properly.
    So how to do it the right way?
    thank you!!

  • #2
    Hi, that looks like a bug. Do you experience it with all scenes or just a specific setup? Can you send us a piece of code and/or a .vrscene file to reproduce it?

    Comment


    • #3
      Hi,what I want to do is :
      I Have a scene, and want to get serveral images with diffrent camera viewport.
      the code like this
      Code:
      buildScene();//in this i  build vray scene
      mVRayRenderer->setImageSize(imageWidth, imageHeight);
      mVRayRenderer->setRenderMode(VRay::VRayRenderer::RENDER_MODE_PRO DUCTION_CUDA);
      mVRayRenderer->setKeepInteractiveRunning(false);
      const int num =4;
      for(int i=0;i<num;i++)
      {
         mRenderView.set_transform(cameraMatrix);//here i update the camera
         mVRayRenderer->startSync();
         mVRayRenderer->waitForRenderEnd();
      
        //get the image result 
       VRay::VRayImage* imgage = mVRayRenderer->getImage();
       ......
      }
      if let this go I will get 4 iamges.
      but if during the rendering, I want ro stop it by a GUI command which will call
      Code:
       mVRayRenderer->stop();
      then the rendering seems to get stuck and I can't end it properly.

      Comment


      • #4
        On first run (only) the CUDA engine compiles its kernels. It takes about 30 - 40 second or so. Currently the code cannot be interrupted so when you call .stop() it still waits for the kernels compilation to finish. If you wait one time only for the procedure to finish, it should begin to behave normally. You can monitor the progress via the logMessage and progress callbacks.

        Comment


        • #5
          thank you,when i start the render using
          Code:
          mVRayRenderer->start();
          .everythis is ok.and I can stop it any time.
          now I change my method to this one. and get the "done signal"from "onRendererStateChanged" .then write the rendering result and start the rendering for next camera position.
          The price is that the code becomes ugly. break one function to some,with some variables in class for help

          Comment


          • #6
            Yeah, you need a state machine to manage "onRendererStateChanged" updates but it's not that hard.

            Comment

            Working...
            X