StatsView in Papervision 2.0

September 7, 2008 by Devin Reimer

Hidden in Papervision 2.0 Beta 1 Great White, there are many features that people are unaware or do not know how to use. Since the API is still in progress and examples are few and far between, I’m going to try to shed some light on some of these features.

The first feature that I’m going to go over is StatsView. I have been looking for a good on-screen display of FPS (frames per second) and triangles being rendered, and in searching the Papervision 2.0 framework, I found what I was after.

Adding StatsView to your project is very simple:

First import the class:
import org.papervision3d.view.stats.StatsView;

After you have created your render (in most cases this will be called ‘BasicRenderEngine’), add your StatsView.

Ex:  renderer = new BasicRenderEngine();
addChild(new StatsView(renderer));

It is that easy – but it’s hidden enough that it is not yet widely used.

Now for a breakdown of what all those abbreviations mean.

  • FPS – Frames Per Second
  • Tri – Triangles
  • Sha – Shaded Triangles
  • Lin – Lines
  • Par – Particles
  • COb – Culled Objects
  • CTr – Culled Triangles
  • CPa – Culled Particles
  • FOb – Filtered Objects
  • Mem – Memory Used

1 Response to "StatsView in Papervision 2.0"

Leave a response