Re: Offscreen rendering - performance issue
Posted by
gouessej on
Mar 11, 2020; 8:37pm
URL: https://forum.jogamp.org/Re-Offscreen-rendering-performance-issue-tp4040432p4040433.html
Hello
It's not efficient because you create a new BufferedImage at each call instead of using a single com.jogamp.opengl.util.GLPixelBuffer and because you use Java2D to render.
Personally, I would switch to a completely different approach. Use a com.jogamp.opengl.util.awt.Overlay and call createGraphics() to get a Graphics2D instance to draw your Java2D shapes. Use a canvas or window (drawable) provided by JOGL in onscreen rendering, put this drawable into the overlay, use an animator. The performance will be much better that way.