discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Why is "re-rendering" a full render (dragging around, zooming, etc) faster than "preview render"? Can the "preview geometry" be cached to let OpenGL/MetalGL/etc make it faster?

JW
Jim Witte
Wed, Jul 13, 2022 5:59 PM

This is probably obvious if I knew where to look in the code I haven’t dug
into.  Why is manipulation of a “full render” of a scene so much faster
(position, rotation, zoom) than the preview renderer - even though the
geometry hasn’t changed in either case?  I assume after a full render, the
resulting geometry is cached and then handled by the underlying hardware.
Could the preview renderer do the same thing?

This is probably obvious if I knew where to look in the code I haven’t dug into. Why is manipulation of a “full render” of a scene so much faster (position, rotation, zoom) than the preview renderer - even though the geometry hasn’t changed in either case? I assume after a full render, the resulting geometry is cached and then handled by the underlying hardware. Could the preview renderer do the same thing?
JB
Jordan Brown
Wed, Jul 13, 2022 6:20 PM

On 7/13/2022 10:59 AM, Jim Witte wrote:

This is probably obvious if I knew where to look in the code I haven’t
dug into.  Why is manipulation of a “full render” of a scene so much
faster (position, rotation, zoom) than the preview renderer - even
though the geometry hasn’t changed in either case?  I assume after a
full render, the resulting geometry is cached and then handled by the
underlying hardware.  Could the preview renderer do the same thing?

I believe that you're correct that viewing a full render is faster
because it's doing less geometry calculation as you move around.

It took me a long time (and looking at the implementation) to understand
that preview does not calculate geometry.  It draws everything in the
entire model, and uses clever ordering and OpenGL settings so that only
the appropriate things show.  It doesn't actually do the unions,
intersections, and differences.

Another way to look at it is that full F6 calculates 3D objects, where
F5 only calculates a 2D view.

On 7/13/2022 10:59 AM, Jim Witte wrote: > This is probably obvious if I knew where to look in the code I haven’t > dug into.  Why is manipulation of a “full render” of a scene so much > faster (position, rotation, zoom) than the preview renderer - even > though the geometry hasn’t changed in either case?  I assume after a > full render, the resulting geometry is cached and then handled by the > underlying hardware.  Could the preview renderer do the same thing? I believe that you're correct that viewing a full render is faster because it's doing less geometry calculation as you move around. It took me a long time (and looking at the implementation) to understand that preview *does not calculate geometry*.  It draws everything in the entire model, and uses clever ordering and OpenGL settings so that only the appropriate things show.  It doesn't actually *do* the unions, intersections, and differences. Another way to look at it is that full F6 calculates 3D objects, where F5 only calculates a 2D view.