Generating Vector Graphics
HOOPS Luminate is a raster rendering engine. This means that it mainly produces bitmaps or video images, that are all based on pixels and raster images. Nevertheless, HOOPS Luminate also features some specific algorithms that can be used to produce vector graphics out of a scene graph. These vector graphics can then be exported to any vector based format by the application, for printing or any other purpose.
Using Pixel Analytics
The HOOPS Luminate API exposes a special ray-tracing callback called the RED::IViewpointRenderList::SetViewpointSoftPixelAnalysisCallback
. This callback is useful to get a complete analysis of all the geometry that interfere with the volume defined by a pixel pyramid:
Traditional ray-tracing algorithms are using rays to intersect scene graph data. This method uses frustum beams for the intersection process. If captures all the data seen by the camera, for each pixel in the image. The callback then has the analytical detail of all the primitive visualized by the different pixels of the image. This can be leveraged to generate vector graphics out of HOOPS Luminate.
In the example above, a pixel in the image generated a truncated pyramid ranging from the camera near distance to the camera far distance. This pyramid is checked against all triangles, points, lines and texts in the scene graph. All the found intersection informations are then transmitted to the pixel analysis callback set by the application.
Please note that the Embree acceleration structure does not support pixel analytics. RED::OPTIONS_RAY_USE_EMBREE
must be set to false.
See the complete tutorial on this topic here: Generating Vector Graphics.