A basic profiling tool that can be used to measure time spent in sections of the engine.

Constructors

Methods

  • Return the total time of each captured frame, in chronological order (up to the last 600 frames).

    Returns number[]

  • Convert measures for a section into texts. Useful for ingame profiling.

    Parameters

    • sectionName: string

      The name of the section

    • profilerSection: FrameMeasureOutput

      The section measures

    • outputs: string[]

      The array where to push the results

    • Optional parentTime: null | number

    Returns void

  • Record what the 3D renderer did on this frame: its cheap per-frame counters, and the shader programs it is holding.

    The renderer compiles a separate program for every distinct combination of the things that shape a shader - material features, the number of lights of each kind, fog, shadow filtering, clipping planes, tone mapping, instancing, and more. Whenever the game moves any of them onto a combination that has not been seen before, that program is compiled and linked on the spot: the cost lands on a single frame, and never again for that combination. It shows up as unexplained stutter early in a playthrough, which is why it is worth measuring rather than guessing.

    Rather than assume a cause, this compares the cache keys the renderer itself uses to tell programs apart, and reports which fields differ from the closest program already seen.

    Parameters

    • rendererInfo: {
          memory?: {
              geometries: number;
              textures: number;
          };
          programs?: null | {
              cacheKey?: string;
              type?: string;
          }[];
          render?: {
              calls: number;
              triangles: number;
          };
      }

      The current WebGLRenderer.info.

      • Optional memory?: {
            geometries: number;
            textures: number;
        }
        • geometries: number
        • textures: number
      • Optional programs?: null | {
            cacheKey?: string;
            type?: string;
        }[]
      • Optional render?: {
            calls: number;
            triangles: number;
        }
        • calls: number
        • triangles: number

    Returns void