@@ -230,11 +230,10 @@ Renderer::InitializationData Renderer::initSceneObjects(const SAssetBundle& mesh
230
230
}
231
231
232
232
//
233
- retval.maxSensorSamples = MaxFreeviewSamples;
234
233
for (const auto & sensor : m_globalMeta->m_global .m_sensors )
235
234
{
236
- if (retval. maxSensorSamples <sensor.sampler .sampleCount )
237
- retval. maxSensorSamples = sensor.sampler .sampleCount ;
235
+ if (maxSensorSamples<sensor.sampler .sampleCount )
236
+ maxSensorSamples = sensor.sampler .sampleCount ;
238
237
}
239
238
}
240
239
@@ -1060,13 +1059,13 @@ void Renderer::initSceneResources(SAssetBundle& meshes, nbl::io::path&& _sampleS
1060
1059
// Mantissa is only 23 bits, and primary sample space low discrepancy sequence will start to produce duplicates
1061
1060
// near 1.0 with exponent -1 after the sample count passes 2^24 elements.
1062
1061
// Another limiting factor is our encoding of sample sequences, we only use 21bits per channel, so no duplicates till 2^21 samples.
1063
- initData. maxSensorSamples = core::min (0x1 <<21 ,initData. maxSensorSamples );
1064
- if (cachedQuantizedDimensions>=quantizedDimensions && cachedSampleCount>=initData. maxSensorSamples )
1062
+ maxSensorSamples = core::min (0x1 <<21 ,maxSensorSamples);
1063
+ if (cachedQuantizedDimensions>=quantizedDimensions && cachedSampleCount>=maxSensorSamples)
1065
1064
sampleSequence.createBufferView (m_driver,std::move (cachebuff));
1066
1065
else
1067
1066
{
1068
1067
printf (" [INFO] Generating Low Discrepancy Sample Sequence Cache, please wait...\n " );
1069
- cachebuff = sampleSequence.createBufferView (m_driver,quantizedDimensions,initData. maxSensorSamples );
1068
+ cachebuff = sampleSequence.createBufferView (m_driver,quantizedDimensions,maxSensorSamples);
1070
1069
// save sequence
1071
1070
io::IWriteFile* cacheFile = m_assetManager->getFileSystem ()->createAndWriteFile (sampleSequenceCachePath);
1072
1071
if (cacheFile)
@@ -1078,7 +1077,7 @@ void Renderer::initSceneResources(SAssetBundle& meshes, nbl::io::path&& _sampleS
1078
1077
}
1079
1078
std::cout << " \t pathDepth = " << pathDepth << std::endl;
1080
1079
std::cout << " \t noRussianRouletteDepth = " << noRussianRouletteDepth << std::endl;
1081
- std::cout << " \t maxSamples = " << initData. maxSensorSamples << std::endl;
1080
+ std::cout << " \t maxSamples = " << maxSensorSamples << std::endl;
1082
1081
}
1083
1082
}
1084
1083
std::cout << std::endl;
@@ -1131,6 +1130,7 @@ void Renderer::deinitSceneResources()
1131
1130
1132
1131
pathDepth = DefaultPathDepth;
1133
1132
noRussianRouletteDepth = 5u ;
1133
+ maxSensorSamples = MaxFreeviewSamples;
1134
1134
}
1135
1135
1136
1136
void Renderer::initScreenSizedResources (uint32_t width, uint32_t height)
@@ -1147,7 +1147,6 @@ void Renderer::initScreenSizedResources(uint32_t width, uint32_t height)
1147
1147
size_t scrambleBufferSize=0u ;
1148
1148
size_t raygenBufferSize=0u ,intersectionBufferSize=0u ;
1149
1149
{
1150
- // TODO
1151
1150
m_staticViewData.pathDepth = pathDepth;
1152
1151
m_staticViewData.noRussianRouletteDepth = noRussianRouletteDepth;
1153
1152
@@ -1706,7 +1705,7 @@ bool Renderer::render(nbl::ITimer* timer, const bool beauty)
1706
1705
// because of direct to screen resolve
1707
1706
|GL_FRAMEBUFFER_BARRIER_BIT|GL_TEXTURE_UPDATE_BARRIER_BIT
1708
1707
);
1709
- m_raytraceCommonData.samplesComputed += getSamplesPerPixelPerDispatch ();
1708
+ m_raytraceCommonData.samplesComputed = (m_raytraceCommonData. samplesComputed + getSamplesPerPixelPerDispatch ())%maxSensorSamples ;
1710
1709
}
1711
1710
1712
1711
// TODO: autoexpose properly
0 commit comments