In release 3.20, we introduced enhanced rendering performance for B-rep representations as a feature. Let's have a closer look at the enhancements and the techniques that have been implemented in CAD Exchanger SDK.
Rendering times before and after implementing the optimization techniques
The rendering of heavy models usually takes more time due to high number of iterations over multitude of parts and assemblies. This also affects FPS, making the rendering process clumsy and laggy. CAD Exchanger utilizes a few approaches to streamline the rendering process. After implementing the optimization techniques, rendering time for B-rep representations in CAD Exchanger has become significantly faster.
On average, due to the enhancements listed below, the rendering performance has been improved by 4-10 times, depending on the complexity of the model being rendered. This means that previously time-consuming rendering tasks can now be completed in a fraction of the time, allowing users to work more effectively.
The benefits of the optimization techniques extend beyond just faster rendering times. They also contribute to a better user experience, as the improved draw performance ensures that interactions with the model are smooth and lag-free. Let's look at how we did it and start with B-rep as a concept in CAD first.
The concept of B-rep in CAD
B-rep is a way of representing objects of a certain volume by means of their boundaries. In B-rep, objects are represented as a collection of faces, edges, and vertices. Faces are planar surfaces that enclose a volume, edges are the boundaries between faces, and vertices are the points where edges meet. By defining these geometric elements, B-rep allows for precise and detailed representation of complex shapes.The main advantage of B-rep is its ability to describe them accurately. It allows for the creation of objects with curved surfaces, holes, and other intricate features.
With CAD Exchanger SDK, software developers can easily import B-rep models from various CAD formats, such as CATIA, SOLIDWORKS, and AutoCAD. CAD Exchanger SDK also allows to render them with stunning visual fidelity, preserving format specific rendering features, including UV mapping, material editing, and transparencies.
3 techniques CAD Exchanger utilizes to optimize rendering performance
Reducing draw calls
One of the most obvious optimization technique is minimizing the number of draw calls for a single model, which may consist of thousands of elements. We have effectively applied this optimization in our rendering engine. By reducing the number of draw calls, CAD Exchanger can significantly improve rendering performance. Draw calls are the commands sent to the GPU to render a specific element or group of elements. Each draw call incurs a certain amount of overhead, as the GPU needs to process and execute the command.
To optimize this process, CAD Exchanger now groups together similar elements and sends them as a single draw call. This reduces the overall number of draw calls and allows the GPU to process them more efficiently. By minimizing the overhead associated with draw calls, CAD Exchanger is able to render complex models much faster.
CPU/GPU load balancing
By offloading some of the rendering calculations to the GPU, CAD Exchanger can achieve better load balancing between the CPU and GPU. This allows for more efficient utilization of both processing units, resulting in faster rendering times.
Traditionally, the CPU has been responsible for handling most of the rendering calculations. However, modern GPUs are designed for a highly parallel computing and excel at performing repetitive tasks, such as rendering graphics. By leveraging the power of the GPU, CAD Exchanger SDK can distribute the rendering workload more evenly between the CPU and GPU, reducing the overall rendering time.
By utilizing CPU/GPU load balancing, CAD Exchanger is able to take advantage of the parallel processing capabilities of the GPU, resulting in significant performance improvements. This technique is particularly effective for rendering complex models, as it allows for faster iteration over multiple parts and assemblies.
Applying caching
The caching mechanism works by storing the rendered data in memory, so that it can be quickly retrieved and displayed when needed. This eliminates the need to re-render the model every time the display mode is switched, resulting in significant time savings.
Moreover, now you can switch between them with all the measurements and calculations saved, allowing for a seamless transition without any loss of data. This is particularly useful when working with complex models that require frequent mode changes for different analysis or visualization purposes.
The caching mechanism also improves efficiency by reducing the amount of data that needs to be processed and transferred between the CPU and GPU. This minimizes the computational load on the system and allows for smoother and more responsive interactions with the model. This enhancement greatly improves the user experience and efficiency when working with B-rep representations in CAD Exchanger products.
Summary
Overall, the implementation of these optimization techniques in CAD Exchanger products has significantly enhanced the drawing speed and rendering, which, in turn, increases the efficiency when working with B-rep models and improves the outcomes of CAD projects.
While this blog post has focused on enhancing rendering performance for B-rep representations, CAD Exchanger's engineers are also actively working on improving rendering performance for polygonal geometry. Stay tuned for future updates and advancements in this area as CAD Exchanger continues to innovate and optimize rendering capabilities for all types of CAD models.
The videos from this article were created using the models by Nicolas and Armando Amaro.