Skip to content

Conversation

@mvaligursky
Copy link
Contributor

@mvaligursky mvaligursky commented Nov 25, 2025

This PR enhances the frame:ready event in the GSplat component system by replacing the boolean loading parameter with a numeric loadingCount parameter that reports the exact number of assets being loaded.

  • Provides granular information about loading state (exact count vs boolean)
  • Enables progress tracking for loading screens and UI feedback
  • Non-breaking: existing code using if (!loading) works with if (!loadingCount)

Progress Tracking Example

// Track loading progress (0..1)
let maxLoadingCount = 0;
app.systems.gsplat.on('frame:ready', (camera, layer, ready, loadingCount) => {
    maxLoadingCount = Math.max(maxLoadingCount, loadingCount);
    const progress = maxLoadingCount > 0 ? (maxLoadingCount - loadingCount) / maxLoadingCount : 1;
    console.log(`Loading progress: ${(progress * 100).toFixed(1)}%`);
});

@mvaligursky mvaligursky self-assigned this Nov 25, 2025
@mvaligursky mvaligursky added enhancement Request for a new feature area: graphics Graphics related issue labels Nov 25, 2025
@mvaligursky mvaligursky requested a review from a team November 25, 2025 11:19
@mvaligursky mvaligursky merged commit 6b6c934 into main Nov 25, 2025
7 checks passed
@mvaligursky mvaligursky deleted the mv-gsplat-progress branch November 25, 2025 11:59
mvaligursky added a commit that referenced this pull request Nov 25, 2025
* Add loadingCount parameter to GSplat frame:ready event

* removed unused internal function

---------

Co-authored-by: Martin Valigursky <mvaligursky@snapchat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: graphics Graphics related issue enhancement Request for a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants