MCPcopy Create free account
hub / github.com/LuxCoreRender/LuxCore / DoRendering

Function DoRendering

samples/luxcorescenedemo/luxcorescenedemo.cpp:192–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190}
191
192static void DoRendering(RenderSession *session) {
193 const unsigned int haltTime = session->GetRenderConfig().GetProperties().Get(Property("batch.halttime")(0)).Get<unsigned int>();
194 const unsigned int haltSpp = session->GetRenderConfig().GetProperties().Get(Property("batch.haltspp")(0)).Get<unsigned int>();
195
196 char buf[512];
197 const Properties &stats = session->GetStats();
198 while (!session->HasDone()) {
199 boost::this_thread::sleep(boost::posix_time::millisec(1000));
200
201 session->UpdateStats();
202 const double elapsedTime = stats.Get("stats.renderengine.time").Get<double>();
203 const unsigned int pass = stats.Get("stats.renderengine.pass").Get<unsigned int>();
204 const float convergence = stats.Get("stats.renderengine.convergence").Get<unsigned int>();
205
206 // Print some information about the rendering progress
207 sprintf(buf, "[Elapsed time: %3d/%dsec][Samples %4d/%d][Convergence %f%%][Avg. samples/sec % 3.2fM on %.1fK tris]",
208 int(elapsedTime), int(haltTime), pass, haltSpp, 100.f * convergence,
209 stats.Get("stats.renderengine.total.samplesec").Get<double>() / 1000000.0,
210 stats.Get("stats.dataset.trianglecount").Get<double>() / 1000.0);
211
212 LC_LOG(buf);
213 }
214
215 // Save the rendered image
216 session->GetFilm().SaveOutputs();
217}
218
219int main(int argc, char *argv[]) {
220 try {

Callers 1

mainFunction · 0.85

Calls 7

Get<unsigned int>Method · 0.80
GetMethod · 0.80
GetStatsMethod · 0.80
Get<double>Method · 0.80
SaveOutputsMethod · 0.80
HasDoneMethod · 0.45
UpdateStatsMethod · 0.45

Tested by

no test coverage detected