AdamYuan / SparseVoxelOctree

A GPU SVO Builder using rasterization pipeline, a efficient SVO ray marcher and a simple SVO path tracer.
MIT License
625 stars 55 forks source link

Bounce vs real frame number #24

Closed tigrazone closed 11 months ago

tigrazone commented 11 months ago

Hello. Why you use m_bounce to calculate spp for divide accumulated but not use real frame number?

https://github.com/AdamYuan/SparseVoxelOctree/blob/3b175fc872552a859adba675620149c7a2020849/shader/path_tracer.comp#L123

AdamYuan commented 11 months ago

I store 'samples per pixel' with the last array entry of uSobol array, and its index is (uBounce + 1) * 2

tigrazone commented 11 months ago

Little bit strange ;-) I find it in code https://github.com/AdamYuan/SparseVoxelOctree/blob/3b175fc872552a859adba675620149c7a2020849/src/PathTracer.cpp#L184

Why you do it this way?

tigrazone commented 11 months ago

uBounce/m_bounce is not an frame number. uBounce/m_bounce is max depth of tracing of ray

AdamYuan commented 11 months ago

https://github.com/AdamYuan/SparseVoxelOctree/blob/3b175fc872552a859adba675620149c7a2020849/shader/sobol.comp#L83 the last element in uSobol array is increased per 'frame'

AdamYuan commented 11 months ago

and uDimension is (m_bounce + 1) * 2

tigrazone commented 11 months ago

last element in uSobol array used only for spp calculation or for random numbers also?

AdamYuan commented 11 months ago

only for spp

tigrazone commented 11 months ago

thank you for answers