[Ves] Poor render performance in Kiwiviewer

Carlos ves at calculoandamios.com
Tue Jun 25 09:24:44 EDT 2013


Hi Aashish,

 

I want to display scaffolds with a lot of parts and for each part I create
an actor, mainly with cylinders and boxes (I'm thinking if this is the right
approach for mobile apps or if as not selection is done at the moment I
would be worthy to create only one with all the components).

For each "component" I create a mapper that I use for all the actors that
paint that component and I set the mappers in the way I explained before.

If I have a model with 600 components I need 600 actors. In a desktop
version I use the Shallowcopy method that I remember it is much faster than
creating 600 actor,  at least for rendering the first time.

 

I have made some test changing the resolution of the cylinders (from  a
SetResolution(36) to a SetResolution(12) ) to reduce the number of triangles
but I have not found big differences. I will check the App with the Mac
OpenGL tool as I have not tried yet.

 

 

Best regards,

 

Carlos

 

 

De: Aashish Chaudhary [mailto:aashish.chaudhary at kitware.com] 
Enviado el: lunes, 24 de junio de 2013 20:38
Para: Carlos
CC: ves at public.kitware.com
Asunto: Re: [Ves] Poor render performance in Kiwiviewer

 

HI Carlos, 

 

I can provide a detailed response later (just got back). Can you provide
some more information on your data type, size, and need for creating 600
actors. Also, did you verify where you have the most time consumed in your
application (using Mac OpenGL tool). Once the geometry is stored in VBO's I
would not expected the rendering to be bottleneck unless you are filling in
more than what your card provide in which case it will drop, recreate VBO's
data as needed. 

 

All of the code related to render stage and and render targets are related
to render tree which does not delete your previously created mapper and
therefore VBO's (if you find otherwise let us know).

 

Thanks for the feedback. Looking for some more information here. Will follow
up with you on another email later. 

 

- Aashish

 

 

 

On Mon, Jun 24, 2013 at 2:01 PM, Carlos <ves at calculoandamios.com> wrote:

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


_______________________________________________
Ves mailing list
Ves at public.kitware.com
http://public.kitware.com/cgi-bin/mailman/listinfo/ves





 

-- 
| Aashish Chaudhary 
| R&D Engineer         
| Kitware Inc.            
| www.kitware.com    

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/ves/attachments/20130625/a165724b/attachment-0001.html>


More information about the Ves mailing list