Skip to content

Add MiniStats stat presets for gsplat stats#8495

Merged
mvaligursky merged 3 commits intomainfrom
mv-mini-stats-gsplat
Mar 3, 2026
Merged

Add MiniStats stat presets for gsplat stats#8495
mvaligursky merged 3 commits intomainfrom
mv-mini-stats-gsplat

Conversation

@mvaligursky
Copy link
Contributor

@mvaligursky mvaligursky commented Mar 3, 2026

Summary

  • Add MiniStats.statPresets static property with predefined stat groups (gsplats, gsplatsCopy)
  • Extend MiniStats.getDefaultOptions() to accept an optional extraStats array of preset names, inserting them after the 'Frame' stat entry
  • User-specified array order matches visual top-to-bottom display order
  • Simplify gsplat examples (lod-streaming, flipbook) to use the new preset API instead of manual option splicing

Public API Changes

Before:

const msOptions = pc.MiniStats.getDefaultOptions();
const frameIndex = msOptions.stats.findIndex(s => s.name === 'Frame');
msOptions.stats.splice(frameIndex + 1, 0, {
    name: 'GSplats',
    stats: ['frame.gsplats'],
    decimalPlaces: 3,
    multiplier: 1 / 1000000,
    unitsName: 'M',
    watermark: 10
}, {
    name: 'GsplatsCopy',
    stats: ['frame.gsplatBufferCopy'],
    decimalPlaces: 1,
    multiplier: 1,
    unitsName: '%',
    watermark: 100
});
const miniStats = new pc.MiniStats(app, msOptions);

After:

const miniStats = new pc.MiniStats(app, pc.MiniStats.getDefaultOptions(['gsplats', 'gsplatsCopy']));

Backward compatible — getDefaultOptions() with no arguments returns the same result as before.

Add statPresets static property and extraStats parameter to
MiniStats.getDefaultOptions(), allowing predefined stat groups to be
included with a simple array of names instead of manual option splicing.

Simplify gsplat examples to use the new preset API.

Made-with: Cursor
@mvaligursky mvaligursky merged commit 6db99c8 into main Mar 3, 2026
8 checks passed
@mvaligursky mvaligursky deleted the mv-mini-stats-gsplat branch March 3, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Relating to load times or frame rate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant