Few months ago, the OCCT ray tracing algorithm was rewritten using GLSL. Apart from better portability and certain performance gain, this step opened the door to some important features that can be added most naturally using close OpenGL and GLSL interoperation - such as visualization of lines and text in a ray-traced scene. Lines and text are examples of scene elements that cannot be visualized using purely the ray tracing algorithm.
The idea behind was to draw these "non-ray-traceable" scene elements with help of OpenGL rasterization and then add the ray-traced (shaded) elements using the frame buffer and depth buffer data prepared at the previous step.
Recently, support for lines, markers and text have been implemented in the frames of OCCT Mantis issue 24819 using the above-mentioned combined approach. Currently, this functionality is available in OCCT Git master.
Most important benefits resulted from this improvement are listed below:
- Interactive selection now works in a ray-traced scene exactly the same way as in a rasterized scene
- CAD models can be displayed in a ray-traced scene in both shading and wireframe
- Auxiliary scene elements such as markers and text labels no longer disappear from a 3D view after switching to ray tracing rendering
- Text annotations can now be added to a ray-traced scene in a common way - i.e. using the standard 2D over-layer of a V3d_View instance
The few snapshots below should illustrate improved ray tracing algorithm results better than words.
|A simple ray-traced scene created by OCCT test case v3d/raytrace/bug24819|
|Ray-traced scene containing the pump model from the gallery at www.opencascade.org with the axis and bolt shown in wireframe|
|Ray-traced scene containing the same pump model with one part highlighted by interactive detection|