Interface InfiniteEnginePerformanceInterface

The InfiniteEnginePerformanceInterface interface is used to control the resources allocated to the renderer, be it cache, maximum number of displayed triangles and memory consumption.

Changing values for the performance object may store the new parameters in the localStorage of the browser, thus allowing the user to set specific information for its hardware, and using these values for subsequent object creations.

The maximum amount of GPU memory consumption (VRAM) for geometries, the working memory (used when simultaneously downloading geometries), the maximum amount of displayed triangles and the quality (in term of number of triangles) of the dynamic low definition of the DMU can also be set.

These values should reflect the "quality" of the hardware the API runs on. Please refer to the InfiniteEngineInterface for more precisions.

/** 
* Sample to illustrate setting some performance settings of the InfiniteEngineInterface
* by using the PerformanceInterface.
*/
import { InfiniteEngineInterface, InfiniteEnginePerformanceInterface } from 'generated_files/documentation/appinfiniteapi';

// created previously
let lInfiniteEngine : InfiniteEngineInterface;
// get the performance interface
const lPerformanceInfos : InfiniteEnginePerformanceInterface = lInfiniteEngine.getPerformance();

// reset the number of triangles to display in the dynamic low definition DMU
lPerformanceInfos.setMaxDynamicLowDefTrianglesDisplayedCount(lPerformanceInfos.GetMaxDynamicLowDefTrianglesDefault());
// reset the number of total triangles to be displayed
lPerformanceInfos.setMaxTrianglesDisplayedCount(lPerformanceInfos.GetMaxTrianglesDefault());
// reset the VRAM (RAM on the GPU) amount to be used
lPerformanceInfos.setMaxRenderingMemory(lPerformanceInfos.GetMaxRenderingMemoryDefault());
// reset the RAM to use when downloading data (if geometries are too big, less geometries will be downloaded at the same time)
lPerformanceInfos.setMaxWorkingMemory(lPerformanceInfos.GetMaxWorkingMemoryDefault());

.
3D Rendering

interface InfiniteEnginePerformanceInterface {
    GetMaxDynamicLowDefTrianglesDefault(): number;
    GetMaxDynamicLowDefTrianglesInit(): number;
    GetMaxDynamicLowDefTrianglesMin(): number;
    GetMaxRenderedGeometriesCountDefault(): number;
    GetMaxRenderedGeometriesCountInit(): number;
    GetMaxRenderedGeometriesCountMin(): number;
    GetMaxRenderingMemoryDefault(): number;
    GetMaxRenderingMemoryInit(): number;
    GetMaxRenderingMemoryMin(): number;
    GetMaxTrianglesDefault(): number;
    GetMaxTrianglesInit(): number;
    GetMaxTrianglesMin(): number;
    GetMaxWorkingMemoryDefault(): number;
    GetMaxWorkingMemoryInit(): number;
    GetMaxWorkingMemoryMin(): number;
    fromJSON(pEnginePerformanceData): boolean;
    getCurrentDynamicLowDefTrianglesDisplayedCount(): number;
    getCurrentRenderedGeometriesCount(): number;
    getCurrentRenderingMemory(): number;
    getCurrentTrianglesDisplayedCount(): number;
    getCurrentWorkingMemory(): number;
    getMaxDynamicLowDefTrianglesDisplayedCount(): number;
    getMaxRenderedGeometriesCount(): number;
    getMaxRenderingMemory(): number;
    getMaxTrianglesDisplayedCount(): number;
    getMaxWorkingMemory(): number;
    isFrameBufferStatusChecked(): boolean;
    isShaderCompilationChecked(): boolean;
    resetDefaultValues(pSetAsDefaultInit?): boolean;
    setFrameBufferStatusChecked(pCheckStatus): void;
    setMaxDynamicLowDefTrianglesDisplayedCount(pMaxTrianglesCount, pSetAsDefaultInit?): boolean;
    setMaxRenderedGeometriesCount(pMaxRenderedGeometriesCount, pSetAsDefaultInit?): boolean;
    setMaxRenderingMemory(pMaxBytesCount, pSetAsDefaultInit?): boolean;
    setMaxTrianglesDisplayedCount(pMaxTrianglesCount, pSetAsDefaultInit?): boolean;
    setMaxWorkingMemory(pMaxBytesCount, pSetAsDefaultInit?): boolean;
    setShaderCompilationChecked(pCheckCompilation): void;
    toJSON(pKey?): Object;
}

Methods

  • Gets the default (initialization) maximum number of displayed triangles for the dynamic low definition model.

    This value is a constant, arbitrary set by the library 1 000 000.

    Returns number

    The default maximum number of displayed triangles for the dynamic low definition model.

  • Gets the current (initialization) maximum number of displayed triangles for the dynamic low definition model.

    Returns number

    The current maximum number of displayed triangles for the dynamic low definition model set at initialization.

  • Gets the default (initialization) maximum number of distinct rendered geometries that may be rendered at a time.

    This value is a constant, arbitrary set by the library 20 000.

    Returns number

    The default maximum number of distinct rendered geometries that may be rendered at a time.

  • Gets the current (initialization) maximum number of distinct rendered geometries that may be rendered at a time.

    Returns number

    The current maximum number of distinct rendered geometries that may be rendered at a time.

  • Gets the default (initialization) maximum amount of memory used to render high definition geometries (in bytes).

    This value is a constant, arbitrary set by the library 2 GB.

    Returns number

    The default maximum number of bytes used to render HD geometries.

  • Gets the current (initialization) maximum amount of memory used to render high definition geometries (in bytes).

    Returns number

    The current maximum number of bytes used to render HD geometries set at initialization.

  • Gets the minimal amount of memory used to render high definition geometries that can be set by setMaxRenderingMemory(in bytes).

    This value is a constant, arbitrary set by the library 512 MB.

    Returns number

    The minimum value that can be set by setMaxRenderingMemory.

  • Gets the default (initialization) maximum number of displayed triangles.

    This value is a constant, arbitrary set by the library 10 000 000.

    Returns number

    The default maximum number of displayed triangles.

  • Gets the current (initialization) maximum number of displayed triangles.

    Returns number

    The current maximum number of displayed triangles set at initialization.

  • Gets the default (initialization) maximum amount of memory allocated to process the parallel downloading of high definition geometries (in bytes).

    This value is a constant, arbitrary set by the library 256 MB.

    Returns number

    The default maximum number of working bytes.

  • Gets the current (initialization) maximum amount of memory allocated to process the parallel downloading of high definition geometries (in bytes).

    Returns number

    The current maximum number of working bytes set at initialization.

  • Gets the minimal amount of memory allocated to process the parallel downloading of high definition geometries that can be set by setMaxWorkingMemory (in bytes).

    This value is a constant, arbitrary set by the library 128 MB.

    Returns number

    The minimum value that can be set by setMaxWorkingMemory.

  • Sets the content of the InfiniteEnginePerformanceInterface from a former call to toJSON.

    InfiniteEnginePerformanceInterface parameters (current and maximum values) may be streamed, using the following schema :

    {
    "$defs": {
    "engineperformance": {
    "additionalProperties": false,
    "properties": {
    "currentdynamiclowdefinitiontriangles": {
    "description": "current number of triangles displayed in the dynamic low definition model, this value is ignored when using fromJSON",
    "minimum": 0,
    "type": "integer"
    },
    "currentrenderedgeometriescount": {
    "description": "current number of distinct geometries (that may be instantiated multiple times) that are rendered at a time",
    "minimum": 0,
    "type": "integer"
    },
    "currentrenderingmemory": {
    "description": "current number of bytes of memory used in rendering the high definition models",
    "minimum": 0,
    "type": "integer"
    },
    "currenttriangles": {
    "description": "current number of high definition model triangles displayed, this value is ignored when using fromJSON",
    "minimum": 0,
    "type": "integer"
    },
    "currentworkinggmemory": {
    "description": "current number of bytes of memory used in downloading / parsing high definition modeles",
    "minimum": 0,
    "type": "integer"
    },
    "maxdynamiclowdefinitiontriangles": {
    "description": "maximum number of triangles to use in the dynamic low definition model",
    "minimum": 1000000,
    "type": "integer"
    },
    "maxrenderedgeometriescount": {
    "description": "maximum number of distinct geometries (that may be instantiated multiple times) that may be rendered at a time",
    "minimum": 10000,
    "type": "integer"
    },
    "maxrenderingmemory": {
    "description": "maximum number of bytes of memory to use in rendering the high definition models",
    "minimum": 1000000,
    "type": "integer"
    },
    "maxtriangles": {
    "description": "maximum number of high definition model triangles to display",
    "minimum": 2000000,
    "type": "integer"
    },
    "maxworkinggmemory": {
    "description": "maximum number of bytes of memory to use when downloading / parsing high definition modeles, minimum is 128 MB",
    "minimum": 134217728,
    "type": "integer"
    },
    "type": {
    "const": "engineperformance",
    "description": "Type of object",
    "type": "string"
    },
    "version": {
    "description": "Define the version of the object",
    "example": 1,
    "type": "integer"
    }
    },
    "required": [
    "type",
    "version"
    ],
    "type": "object"
    }
    },
    "$ref": "#/$defs/engineperformance",
    "$schema": "https://json-schema.org/draft-07/schema#"
    }

    This schema may evolve in the future.

    NB : You cannot set the future default values with this call.

    Parameters

    • pEnginePerformanceData: string | Object
      in
      Internal InfiniteEnginePerformanceInterface data to set.

    Returns boolean

    true if the data is set.

  • Gets the current amount of triangles used to show some lower definitions of the DMU.

    This parameter is highly optional, you should not need to change anything in most circumstances.

    Returns number

    The current number of triangles used to show some lower definitions of the DMU.

  • Gets the current number of distinct geometries (that may be instantiated multiple times) that are rendered at this time.

    Returns number

    The current number of geometries that are rendered at this time.

  • Gets the current amount of memory used to render high definition geometries (in bytes).

    Returns number

    The current number of bytes used to render HD geometries.

  • Gets the current number of displayed triangles.

    Returns number

    The number of displayed triangles.

  • Gets the current amount of memory used to render high definition geometries (in bytes).

    Returns number

    The current number of bytes used to render HD geometries.

  • Gets the maximum number of displayed triangles for the dynamic low definition model.

    This value defaults to 1 000 000.

    Returns number

    The maximum number of displayed triangles for the dynamic low definition model.

  • Gets the maximum number of distinct geometries (that may be instantiated multiple times) that may be rendered at a time.

    This parameter is highly optional, you should not need to change anything in most circumstances.

    This value defaults to 20 000.

    Returns number

    The maximum number of distinct geometries displayed at a time.

  • Gets the maximum amount of memory used to render high definition geometries (in bytes).

    At most getMaxRenderingMemory bytes will be used by the graphic card to render HD geometries. Such a budget should be a little less than the VRAM of the graphic card of the end-user.

    This value defaults to 2 GB.

    Returns number

    The maximum number of dedicated bytes to render HD geometries.

  • Gets the maximum number of displayed triangles.

    No more than getMaxTrianglesDisplayedCount triangles will be displayed.

    This value defaults to 10 000 000.

    Returns number

    The maximum number of displayed triangles.

  • Gets the maximum amount of memory allocated to process the parallel downloading of high definition geometries (in bytes).

    This parameter is highly optional, you should not need to change anything in most circumstances.

    This value defaults to 256 MB.

    Returns number

    The maximum number of working bytes.

  • Tells if the frame buffer objects status should be tested (debug troubleshooting).

    This value is set to false by default. The frame buffer status check procedure slows the rendering pipe with the first frame and when the window is resized. Such a value is not stored in the localStorage of the browser.

    Returns boolean

    true if the frame buffer objects status will be checked.

  • Tells if the shaders compilation check is done (debug troubleshooting).

    This value is set to false by default. The shader compilation check procedure slows the rendering pipe with the first frame and when the window is resized. Such a value is not stored in the localStorage of the browser.

    Returns boolean

    true if the shader compilation result is checked.

  • Resets the performance to its default values.

    Parameters

    • Optional pSetAsDefaultInit: boolean
      in
      if set and true, then the default values will be also used as initialization values.

    Returns boolean

    true if the default values were reset.

  • Sets if the frame buffer objects status should be tested (debug troubleshooting).

    This value is set to false by default. The frame buffer status check procedure slows the rendering pipe with the first frame and when the window is resized. Such a value is not stored in the localStorage of the browser.

    Parameters

    • pCheckStatus: boolean
      in
      If set to true, the frame buffer objects status will be checked.

    Returns void

  • Sets the maximum number of displayed triangles for the dynamic low definition model.

    This value defaults to 1 000 000.

    Parameters

    • pMaxTrianglesCount: number
      in
      The new maximum number of triangles displayed for the dynamic low definition model.
    • Optional pSetAsDefaultInit: boolean
      in
      if set and true, then the given value is also used as default initialization value.

    Returns boolean

    true if the value is greater than GetMaxDynamicLowDefTrianglesMin.

  • Sets the maximum number of distinct geometries (that may be instantiated multiple times) that may be rendered at a time.

    This parameter is highly optional, you should not need to change anything in most circumstances.

    This value defaults to 20 000.

    Parameters

    • pMaxRenderedGeometriesCount: number
      in
      The maximum number of geometries displayed at a time.
    • Optional pSetAsDefaultInit: boolean
      in
      if set and true, then the given value is also used as default.

    Returns boolean

    true if the value is greater than GetMaxRenderedGeometriesCountMin.

  • Sets the maximum amount of memory used to render high definition geometries (in bytes).

    At most getMaxRenderingMemory bytes will be used by the graphic card to render HD geometries. Such a budget should be a little less than the VRAM of the graphic card of the end-user.

    This value defaults to 2 GB.

    Parameters

    • pMaxBytesCount: number
      in
      The maximum number of dedicated bytes to render HD geometries.
    • Optional pSetAsDefaultInit: boolean
      in
      if set and true, then the given value is also used as default.

    Returns boolean

    true if the value is greater than GetMaxRenderingMemoryMin.

  • Sets the maximum number of displayed triangles.

    This value defaults to 10 000 000.

    Parameters

    • pMaxTrianglesCount: number
      in
      The new maximum number of displayed triangles.
    • Optional pSetAsDefaultInit: boolean
      in
      if set and true, then the given value is also used as default initialization value.

    Returns boolean

    true if the value greater than GetMaxTrianglesMin.

  • Sets the maximum amount of memory allocated to process the parallel downloading of high definition geometries (in bytes).

    This parameter is highly optional, you should not need to change anything in most circumstances.

    This value defaults to 256 MB.

    Parameters

    • pMaxBytesCount: number
      in
      The maximum number of dedicated bytes to render HD geometries.
    • Optional pSetAsDefaultInit: boolean
      in
      if set and true, then the given value is also used as default.

    Returns boolean

    true if the value is greater than GetMaxWorkingMemoryMin.

  • Sets if the shaders compilation check should be done (debug troubleshooting).

    This value is set to false by default. The shader compilation check procedure slows the rendering pipe with the first frame and when the window is resized. Turning this value to false increases performance. Such a value is not stored in the localStorage of the browser.

    Parameters

    • pCheckCompilation: boolean
      in
      If set to true, the shader compilation result will be checked.

    Returns void

  • Gets a deep copy of the internal data of the InfiniteEnginePerformanceInterface.

    Maximum and current values are dumped.

    Please refer to JSON.stringify.

    Parameters

    • Optional pKey: any
      in
      Unused.

    Returns Object

    The internal InfiniteEnginePerformanceInterface data.