@inweb/viewer-core
Version:
3D CAD and BIM data Viewer core
145 lines (144 loc) • 3.09 kB
TypeScript
/**
* Perfomance metrics.
*/
export interface IPerformanceInfo {
/**
* Frames Per Second: the measure of rendering performance and smoothness.
*/
fps: number;
/**
* The time it takes to render a single frame.
*/
frameTime: number;
/**
* The time from loading the file to the first frame being rendered on screen.
*/
timeToFirstRender: number;
/**
* The total file loading time.
*/
loadTime: number;
}
/**
* Render related metrics.
*/
export interface IRenderInfo {
/**
* The current width and height of the rendering canvas.
*/
viewport: {
width: number;
height: number;
};
/**
* The current anti-aliasing technique being used.
*/
antialiasing: string;
/**
* The number of draw calls of the current frame.
*/
drawCalls: number;
/**
* The number of rendered triangle primitives of the current frame.
*/
triangles: number;
/**
* The number of rendered point primitives of the current frame.
*/
points: number;
/**
* The number of rendered line primitives of the current frame.
*/
lines: number;
}
/**
* Scene related metrics.
*/
export interface ISceneInfo {
/**
* The total number of objects in the scene graph.
*/
objects: number;
/**
* The total number of triangles in the entire scene.
*/
triangles: number;
/**
* The total number of point primitives in the scene.
*/
points: number;
/**
* The total number of lines in the scene.
*/
lines: number;
/**
* The total number of edges in the scene.
*/
edges: number;
}
/**
* Memory related metrics.
*/
export interface IMemoryInfo {
/**
* The number of unique geometries and the memory they consume.
*/
geometries: number;
geometryBytes: number;
/**
* The number of textures and the memory they consume.
*/
textures: number;
textureBytes: number;
/**
* The number of unique materials in use.
*/
materials: number;
/**
* An estimation of the total VRAM being used by the WebGL context.
*/
totalEstimatedGpuBytes: number;
usedJSHeapSize: number;
}
/**
* System information.
*/
export interface ISystemInfo {
/**
* Renderer string of the graphics driver.
*/
webglRenderer: string;
/**
* Vendor string of the graphics driver.
*/
webglVendor: string;
}
/**
* The statistical information about the scene, GPU memory and the rendering process.
*/
export interface IInfo {
/**
* Perfomance metrics.
*/
performance: IPerformanceInfo;
/**
* Render related metrics.
*/
render: IRenderInfo;
/**
* Scene related metrics.
*/
scene: ISceneInfo;
/**
* Scene related metrics after optimization.
*/
optimizedScene: ISceneInfo;
/**
* Memory related metrics.
*/
memory: IMemoryInfo;
/**
* System information.
*/
system: ISystemInfo;
}