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
Modifier and TypeFieldDescriptionprotected boolean
Enables or disables updates.IDs of all FBOs in use.protected int
ID of the most recently used shader.protected int
Number of active frame buffers.protected int
Number of active shaders.protected int
Number of active textures.protected int
Number of FBO switches during the current frame.protected int
Number of object used during the current frame.protected int
Number of shader switches during the current frame.protected int
Number of texture binds during the current frame.protected int
Number of mesh primitives rendered during the current frame.protected int
Number of uniforms set during the current frame.protected int
Number of mesh vertices rendered during the current frame.IDs of all shaders in use.IDs of all textures in use. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Clears all frame-specific statistics such as objects used per frame.void
Called when video memory is cleared.void
getData
(int[] data) Retrieves the statistics data into the given array.String[]
Returns a list of labels corresponding to each statistic.boolean
Tests whether updates are enabled.void
Called by the Renderer when it deletes a framebuffer.void
Called by the Renderer when it deletes a shader.void
Called by the Renderer when it deletes a texture.void
onFrameBufferUse
(FrameBuffer fb, boolean wasSwitched) Called by the Renderer when a framebuffer has been set.void
onMeshDrawn
(Mesh mesh, int lod) Called by the Renderer when a mesh has been drawn.void
onMeshDrawn
(Mesh mesh, int lod, int count) Called by the Renderer when a mesh has been drawn.void
Called by the Renderer when it creates a new framebuffer.void
Called by the Renderer when it creates a new shader.void
Called by the Renderer when it creates a new texture.void
onShaderUse
(Shader shader, boolean wasSwitched) Called by the Renderer when a shader has been utilized.void
onTextureUse
(Image image, boolean wasSwitched) Called by the Renderer when a texture has been set.void
Called by the Renderer when a uniform was set.void
setEnabled
(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
-