mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-02-01 10:30:08 -05:00
--Bug fixes
-ETA in the final render dialog was not correct when doing incremental renders.
This commit is contained in:
parent
b31f45251c
commit
c23d2ad049
@ -1267,7 +1267,6 @@ EmberStats Renderer<T, bucketT>::Iterate(size_t iterCount, size_t temporalSample
|
|||||||
//Timing t2(4);
|
//Timing t2(4);
|
||||||
m_IterTimer.Tic();
|
m_IterTimer.Tic();
|
||||||
size_t totalItersPerThread = size_t(ceil(double(iterCount) / double(m_ThreadsToUse)));
|
size_t totalItersPerThread = size_t(ceil(double(iterCount) / double(m_ThreadsToUse)));
|
||||||
double percent, etaMs;
|
|
||||||
EmberStats stats;
|
EmberStats stats;
|
||||||
//vector<double> accumTimes(4);
|
//vector<double> accumTimes(4);
|
||||||
|
|
||||||
@ -1334,7 +1333,7 @@ EmberStats Renderer<T, bucketT>::Iterate(size_t iterCount, size_t temporalSample
|
|||||||
|
|
||||||
if (m_Callback && threadIndex == 0)
|
if (m_Callback && threadIndex == 0)
|
||||||
{
|
{
|
||||||
percent = 100.0 *
|
auto percent = 100.0 *
|
||||||
double
|
double
|
||||||
(
|
(
|
||||||
double
|
double
|
||||||
@ -1343,6 +1342,7 @@ EmberStats Renderer<T, bucketT>::Iterate(size_t iterCount, size_t temporalSample
|
|||||||
(
|
(
|
||||||
//Takes progress of current thread and multiplies by thread count.
|
//Takes progress of current thread and multiplies by thread count.
|
||||||
//This assumes the threads progress at roughly the same speed.
|
//This assumes the threads progress at roughly the same speed.
|
||||||
|
//Adding m_LastIter is done so that an incremental render still gives an accurate percentage.
|
||||||
double(m_LastIter + (m_SubBatch[threadIndex] * m_ThreadsToUse)) / double(ItersPerTemporalSample())
|
double(m_LastIter + (m_SubBatch[threadIndex] * m_ThreadsToUse)) / double(ItersPerTemporalSample())
|
||||||
) + temporalSample
|
) + temporalSample
|
||||||
) / double(TemporalSamples())
|
) / double(TemporalSamples())
|
||||||
@ -1352,7 +1352,9 @@ EmberStats Renderer<T, bucketT>::Iterate(size_t iterCount, size_t temporalSample
|
|||||||
|
|
||||||
if (percentDiff >= 10 || (toc > 1000 && percentDiff >= 1))//Call callback function if either 10% has passed, or one second (and 1%).
|
if (percentDiff >= 10 || (toc > 1000 && percentDiff >= 1))//Call callback function if either 10% has passed, or one second (and 1%).
|
||||||
{
|
{
|
||||||
etaMs = ((100.0 - percent) / percent) * m_RenderTimer.Toc();
|
auto startingpercent = 100.0 * (m_LastIter / double(ItersPerTemporalSample()));//This is done to support incremental renders, starting from the percentage it left off on.
|
||||||
|
auto currentpercent = percent - startingpercent;//Current percent in terms of starting percentage. So starting at 50% and progressing 5% will give a value of 5%, not 55%.
|
||||||
|
auto etaMs = currentpercent == 0 ? 0 : (((100.0 - startingpercent) - currentpercent) / currentpercent) * m_RenderTimer.Toc();//Subtract startingpercent from 100% so that it's properly scaled, meaning rendering from 50% - 100% will be treated as 0% - 100%.
|
||||||
|
|
||||||
if (!m_Callback->ProgressFunc(m_Ember, m_ProgressParameter, percent, 0, etaMs))
|
if (!m_Callback->ProgressFunc(m_Ember, m_ProgressParameter, percent, 0, etaMs))
|
||||||
Abort();
|
Abort();
|
||||||
|
@ -1164,7 +1164,9 @@ bool RendererCL<T, bucketT>::RunIter(size_t iterCount, size_t temporalSample, si
|
|||||||
|
|
||||||
if (percentDiff >= 10 || (toc > 1000 && percentDiff >= 1))//Call callback function if either 10% has passed, or one second (and 1%).
|
if (percentDiff >= 10 || (toc > 1000 && percentDiff >= 1))//Call callback function if either 10% has passed, or one second (and 1%).
|
||||||
{
|
{
|
||||||
double etaMs = ((100.0 - percent) / percent) * m_RenderTimer.Toc();
|
auto startingpercent = 100.0 * (m_LastIter / double(ItersPerTemporalSample()));//This is done to support incremental renders, starting from the percentage it left off on.
|
||||||
|
auto currentpercent = percent - startingpercent;//Current percent in terms of starting percentage. So starting at 50% and progressing 5% will give a value of 5%, not 55%.
|
||||||
|
auto etaMs = currentpercent == 0 ? 0 : (((100.0 - startingpercent) - currentpercent) / currentpercent) * m_RenderTimer.Toc();//Subtract startingpercent from 100% so that it's properly scaled, meaning rendering from 50% - 100% will be treated as 0% - 100%.
|
||||||
|
|
||||||
if (!m_Callback->ProgressFunc(m_Ember, m_ProgressParameter, percent, 0, etaMs))
|
if (!m_Callback->ProgressFunc(m_Ember, m_ProgressParameter, percent, 0, etaMs))
|
||||||
Abort();
|
Abort();
|
||||||
|
Loading…
Reference in New Issue
Block a user