Procedural geometry possibility with Shape class in raytracer

Procedural geometry possibility with Shape class in raytracer


  I am exploring the possibility of injecting geometry procedurally [] to the Embree RayTracer.

  Is the Shape class the place to start ?

  Does the ray tracer request geometry bucket by bucket so as to conserve/control memory usage ?


4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

With Embree 2.0 using the Shape class is the right place to start. The getAccel function of the shape would have to return a hand written intersector. You also would change the getAccel function to return the bounding box of the object instead of the RTCGeomtry object. Then use the BackendSceneInstancing found in scene_instancing.h. A simple example of user defined intersectors can be found in tutorial02.

What do you mean with the ray tracer requesting geometry bucket by bucket? Embree expects all geometry to be transmitted before the rendering starts.

I was thinking (probably wrongly) that Embree loads in only those geometry in the ray frustum because to load in *all* the geometry before any rendering start will mean that Embree can only render a scene which fits into it's memory. I was thinking (again probably wrongly) that Embree have a delay load concept which pulls in geometry only at the very last moment so as to converse memory and able to render large scene.

Imagine you have a scene with a million sphere mesh, each with a 1000 vertice, as you render an animated camera which is panning and the sphere gradually becomes visible...

When non of the sphere is in the camera view frustrum, none of the sphere meshes should be loaded into Embree, when the first few sphere meshes appears at the edge of the renderable frame, only those visible sphere meshes should be loaded into Embree for rendering (an further meshes pulled in due to reflection [and the level of reflections])

Now imagine that those sphere meshes are not explicitly defined in an Embree scene but as a Procedural Shape which defines the bounding box of the to-be-created-sphere-mesh. So embree loads this light weight Procedural Shape and intersect the shape's bounding box. If there is a hit, the Procedural Shape's will be queried for the actual mesh information, otherwise, it is discarded.

I hope I have been able to explain it clearly.

Embree requires all geomtry to be present in memory and to be speficied before rendering the scene. However, Embree 2.0 supports a two level scene of objects with a virtual interface. It should be possible to implement that behaviour by implementing objects that load and build geometry if they get traversed. However, using Embree that way got never tested.

Leave a Comment

Please sign in to add a comment. Not a member? Join today