Skip to content

Calculate samples per second from time per pass instead of total render time. - #1911

Merged
leMaik merged 2 commits into
chunky-dev:masterfrom
leMaik:improve-sps
Aug 31, 2026
Merged

leMaik merged 2 commits into
chunky-dev:masterfrom
leMaik:improve-sps

Conversation

@leMaik

@leMaik leMaik commented Aug 30, 2026

Copy link
Copy Markdown
Member

The samples per second used to be just be the total number of samples divided by the total render time. This means that changes while rendering are not shown and the value is a big average.

#1497 tried to solve this by implementing a moving average. This PR re-calculates the SPS from the time per pass (divided by the samples per pass) after every rendering pass instead. Since we already calculate the elapsed time, this has almost no overhead.

I changed the time resolution to nanoseconds to avoid precision errors.

Closes #697
Supersedes #1497 (which inspired this)

Comment thread chunky/src/java/se/llbit/chunky/renderer/scene/Scene.java Outdated
Comment thread chunky/src/java/se/llbit/chunky/renderer/DefaultRenderManager.java Outdated
Comment thread chunky/src/java/se/llbit/chunky/renderer/DefaultRenderManager.java Outdated
Fix ns to ms conversion.

Co-authored-by: Maik Marschner <m.marschner@wertarbyte.com>
@leMaik
leMaik merged commit f2f7ab8 into chunky-dev:master Aug 31, 2026
1 check passed
@leMaik
leMaik deleted the improve-sps branch August 31, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use a moving average for samples per second

1 participant