Get rendering statistics in player

(3 posts) (2 voices)
  • Started 1 year ago by fredericgoncalves
  • Latest reply from fredericgoncalves

Tags:

No tags yet.

  1. fredericgoncalves

    member
    Joined: Aug '14
    Posts: 12

    Hi everyone,

    I'm looking for a way to get the render stats.
    I found in previous posts, several ways to display it in Authoring (in project options and some keyboard options), but I want to display them in a player.

    I've found in the documentation two classes that might help me :
    - vkRenderManagerStats
    - vkRasterizerStats
    The first one, works just fine. I can get frame time and FPS correctly.
    The second one always display 0 with all members I try to display.

    I tried to retrieve the data in a simple execute loop in a behaviour like this :

    bool Execute(const vkTaskContext& iCtx)
    {
    	vkRenderManagerStats rmStats = vkRenderManager::InstancePtr().GetStats();
    	vkRasterizerStats rastStats = rmStats.rstStats;
    
    	messageOne = vkString("Frame rate (fps) : ") + vkRoundi(rmStats.averageFPS);
    	messageTwo = vkString("Last frame time (ms) : ") + rmStats.lastFrameTime;
    	messageThree = vkString("Mesh count : ") + rastStats.currentMeshCount;
    
    	return true;
    }

    The documentation says :

    These values are reset when calling BeginScene and only become valid after a call to EndScene.
    The only exception if for the value beginning with current... we are always valid...

    So, the member currentMeshCount should be greater than 0.

    Thanks.

    Posted 1 year ago #
  2. flamenco

    3DVIA Studio Guru
    Joined: Sep '09
    Posts: 188

    Hi,
    You can display standard stats using keyboard keys, in authoring (at play) but also inside any player.
    Press ² key (the topmost left key on my AZERTY keyboard), it should display a console. Then press F5,F7 or F8 to display stats. Don't forget to close console (pressing ² again) when you have chosen the right stats you want to display, because the open console catches all keyboard events
    Cheers,
    Arnaud.

    Posted 1 year ago #
  3. fredericgoncalves

    member
    Joined: Aug '14
    Posts: 12

    Hello.

    In my case, I want the user to be able to select what information about rendering statistics he want to display.
    So, basically, I need a way to retreive the value selected anddisplay only those in an custom UI.

    Is there any VSL workaround to do it (compute these values) ?

    Thanks

    Posted 1 year ago #

Reply

You must log in to post.