RenderKit / ospray

An Open, Scalable, Portable, Ray Tracing Based Rendering Engine for High-Fidelity Visualization
http://ospray.org
Apache License 2.0
1.01k stars 182 forks source link

Rendering process stops for high number of geometries #508

Open miro-cd opened 2 years ago

miro-cd commented 2 years ago

Hi all, I am trying to render an image with around 65000 cylinders and 20000 spheres and I noticed that the .exe stops right before the renderer is called to render a single frame . However, if I reduce the total number of primitives to around 15000 the .exe runs until the end and I get the .ppm file with all the 15000 gometries.

In the documentation https://www.ospray.org/documentation.html#geometries it is stated that the maximum number of primitives is 2^32, and because of that I was not expecting the aforementioned problem. Is there another threshold parameter that has to be modified to work with a higher number of rendered geometries?

johguenther commented 2 years ago

Indeed, this should work. I tried successfully with ospExamples.exe choosing the random_spheres scene with 100k spheres (by using below patch)

diff --git a/apps/common/ospray_testing/builders/RandomSpheres.cpp b/apps/common/ospray_testing/builders/RandomSpheres.cpp
index 7de355161..4414bcac4 100644
--- a/apps/common/ospray_testing/builders/RandomSpheres.cpp
+++ b/apps/common/ospray_testing/builders/RandomSpheres.cpp
@@ -33,7 +33,7 @@ void Spheres::commit()
 {
   Builder::commit();

-  numSpheres = getParam<int>("numSpheres", 100);
+  numSpheres = getParam<int>("numSpheres", 100000);
 }

 cpp::Group Spheres::buildGroup() const
@@ -46,7 +46,7 @@ cpp::Group Spheres::buildGroup() const
   std::mt19937 gen(randomSeed);

   utility::uniform_real_distribution<float> centerDistribution(-1.f, 1.f);
-  utility::uniform_real_distribution<float> radiusDistribution(0.05f, 0.15f);
+  utility::uniform_real_distribution<float> radiusDistribution(0.0005f, 0.015f);
   utility::uniform_real_distribution<float> colorDistribution(0.5f, 1.f);

   // populate the spheres

Some questions: