Package com.jme3.renderer
Class Statistics
java.lang.Object
com.jme3.renderer.Statistics
Allows tracking of real-time rendering statistics.
The Statistics can be retrieved by using Renderer.getStatistics().
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanEnables or disables updates.IDs of all FBOs in use.protected intID of the most recently used shader.protected intNumber of active frame buffers.protected intNumber of active shaders.protected intNumber of active textures.protected intNumber of FBO switches during the current frame.protected intNumber of object used during the current frame.protected intNumber of shader switches during the current frame.protected intNumber of texture binds during the current frame.protected intNumber of mesh primitives rendered during the current frame.protected intNumber of uniforms set during the current frame.protected intNumber of mesh vertices rendered during the current frame.IDs of all shaders in use.IDs of all textures in use. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClears all frame-specific statistics such as objects used per frame.voidCalled when video memory is cleared.voidgetData(int[] data) Retrieves the statistics data into the given array.String[]Returns a list of labels corresponding to each statistic.booleanTests whether updates are enabled.voidCalled by the Renderer when it deletes a framebuffer.voidCalled by the Renderer when it deletes a shader.voidCalled by the Renderer when it deletes a texture.voidonFrameBufferUse(FrameBuffer fb, boolean wasSwitched) Called by the Renderer when a framebuffer has been set.voidonMeshDrawn(Mesh mesh, int lod) Called by the Renderer when a mesh has been drawn.voidonMeshDrawn(Mesh mesh, int lod, int count) Called by the Renderer when a mesh has been drawn.voidCalled by the Renderer when it creates a new framebuffer.voidCalled by the Renderer when it creates a new shader.voidCalled by the Renderer when it creates a new texture.voidonShaderUse(Shader shader, boolean wasSwitched) Called by the Renderer when a shader has been utilized.voidonTextureUse(Image image, boolean wasSwitched) Called by the Renderer when a texture has been set.voidCalled by the Renderer when a uniform was set.voidsetEnabled(boolean f) Enables or disables updates.
-
Field Details
-
enabled
protected boolean enabledEnables or disables updates. -
numObjects
protected int numObjectsNumber of object used during the current frame. -
numTriangles
protected int numTrianglesNumber of mesh primitives rendered during the current frame. -
numVertices
protected int numVerticesNumber of mesh vertices rendered during the current frame. -
numShaderSwitches
protected int numShaderSwitchesNumber of shader switches during the current frame. -
numTextureBinds
protected int numTextureBindsNumber of texture binds during the current frame. -
numFboSwitches
protected int numFboSwitchesNumber of FBO switches during the current frame. -
numUniformsSet
protected int numUniformsSetNumber of uniforms set during the current frame. -
memoryShaders
protected int memoryShadersNumber of active shaders. -
memoryFrameBuffers
protected int memoryFrameBuffersNumber of active frame buffers. -
memoryTextures
protected int memoryTexturesNumber of active textures. -
shadersUsed
IDs of all shaders in use. -
texturesUsed
IDs of all textures in use. -
fbosUsed
IDs of all FBOs in use. -
lastShader
protected int lastShaderID of the most recently used shader.
-
-
Constructor Details
-
Statistics
public Statistics()
-
-
Method Details
-
getLabels
Returns a list of labels corresponding to each statistic.- Returns:
- a list of labels corresponding to each statistic.
- See Also:
-
getData
public void getData(int[] data) Retrieves the statistics data into the given array. The array should be as large as the array given ingetLabels().- Parameters:
data- The data array to write to
-
onMeshDrawn
Called by the Renderer when a mesh has been drawn.- Parameters:
mesh- the Mesh that was drawn (not null)lod- which level of detailcount- multiplier for triangles and vertices
-
onMeshDrawn
Called by the Renderer when a mesh has been drawn.- Parameters:
mesh- the Mesh that was drawn (not null)lod- which level of detail
-
onShaderUse
Called by the Renderer when a shader has been utilized.- Parameters:
shader- The shader that was usedwasSwitched- If true, the shader has required a state switch
-
onUniformSet
public void onUniformSet()Called by the Renderer when a uniform was set. -
onTextureUse
Called by the Renderer when a texture has been set.- Parameters:
image- The image that was setwasSwitched- If true, the texture has required a state switch
-
onFrameBufferUse
Called by the Renderer when a framebuffer has been set.- Parameters:
fb- The framebuffer that was setwasSwitched- If true, the framebuffer required a state switch
-
clearFrame
public void clearFrame()Clears all frame-specific statistics such as objects used per frame. -
onNewShader
public void onNewShader()Called by the Renderer when it creates a new shader. -
onNewTexture
public void onNewTexture()Called by the Renderer when it creates a new texture. -
onNewFrameBuffer
public void onNewFrameBuffer()Called by the Renderer when it creates a new framebuffer. -
onDeleteShader
public void onDeleteShader()Called by the Renderer when it deletes a shader. -
onDeleteTexture
public void onDeleteTexture()Called by the Renderer when it deletes a texture. -
onDeleteFrameBuffer
public void onDeleteFrameBuffer()Called by the Renderer when it deletes a framebuffer. -
clearMemory
public void clearMemory()Called when video memory is cleared. -
setEnabled
public void setEnabled(boolean f) Enables or disables updates.- Parameters:
f- true to enable, false to disable
-
isEnabled
public boolean isEnabled()Tests whether updates are enabled.- Returns:
- true if enabled, otherwise false
-