[Ves] Poor render performance in Kiwiviewer

Carlos ves at calculoandamios.com
Mon Jun 24 14:01:24 EDT 2013


Hi,

 

I create a model with several actors with the following scheme trying to
improve the performance as there are a lot of actors:

 

.         Create an array of Mappers as some of the actors share the same
mapper. The proper way should be to make a shallowcopy but this is not
available right now.

.         Create the actors with: 

 

       vesSharedPtr<vesActor>     Actor;

       Actor =vesSharedPtr<vesActor>(new vesActor());

 

       vesSharedPtr<vesMaterial> Material;

       Material = vesSharedPtr<vesMaterial>(new vesMaterial());

       Actor->setMaterial(Material);

 

       vesSharedPtr<vesBlend> Blend;

       vesSharedPtr<vesDepth> Depth;

 

       Blend = vesSharedPtr<vesBlend>(new vesBlend());

       Depth = vesSharedPtr<vesDepth>(new vesDepth());

 

       Actor->material()->addAttribute(this->shaderProgram());

       Actor->material()->addAttribute(Blend);

       Actor->material()->addAttribute(Depth);

 

             

       Actor->setMapper (MisMappers[My_ID_Mapper]);

 
Actor->mapper()->setColor(color_R,color_G,color_B,1-gradotransparencia);

 

.         Add the actor to the renderer with:

 

       this->renderer()->addActor(Actor);

 

 

the question is that if the number of actors is quite high, around 600, the
FPS in one  Ipad 3 drops to 1 or even less. It makes that rotations are not
continuous. After some debugging I have arrived to the render method in
vesRenderer and I also have look into the calling functions but there are
some point that I do not understand properly.

 

I would like if possible to have a brief explanation of the main calls made
in Render, specially:

 

.         What is done in Cull Traversal.

.         The meaning of renderStage and renderstate

.         Some  clues about the optimization comment  

 

  // By default enable depth test.

  glEnable(GL_DEPTH_TEST);

 

  if (this->m_sceneRoot) {

 

    // Update traversal.

    this->updateTraverseScene();

 

    // Cull traversal.

   this->cullTraverseScene();

 

    vesRenderState renderState;

 

    // Clear all the previous render targets.

    this->m_camera->clearRenderTargets(renderState);

 

    // For now, lets not push camera to the stage, just call

    // render on render target of the current camera.

    this->m_camera->renderTarget()->render(renderState);

 

    this->m_renderStage->render(renderState, 0);

 

    // \note: For now clear the stage.

    // \todo: Add an optimization where we could save whole or

    // part of the the stage.

    this->m_renderStage->clearAll();

 

 

Best regards,

 

Carlos

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/ves/attachments/20130624/8b9193ee/attachment.html>


More information about the Ves mailing list