Login  Register

Re: Texture rendering performance problems

Posted by Demoscene Passivist on Jul 23, 2010; 6:29pm
URL: https://forum.jogamp.org/Texture-rendering-performance-problems-tp966089p990526.html

Generally speaking the are a couple of things u can do to enhance performance of Java2D+JOGL intermix:

- Use -Dsun.java2d.opengl=true AND -Dsun.java2d.noddraw=true to avoid hardware acceleration trouble
- Use GLCanvas and do ur Java2D rendering stuff with com.jogamp.opengl.util.awt.TextureRenderer
- Use VolatileImages in conjunction with -Dsun.java2d.opengl.fbobject=true to render ur Java2D stuff
  See here for further info: http://weblogs.java.net/blog/campbell/archive/2005/09/java2djogl_inte_1.html
- Try using PBOs for CPU base rendering if none of the above works.
  See here for some nice code+benchmarks: http://today.java.net/article/2008/10/28/integrating-glpbuffer-and-java-graphics2d
 
In addition to that I can't really understand why performance of ur texture transfer is so bad. Take a look at this small routine I've done a couple of month ago: http://www.youtube.com/watch?v=zPX8z0du5I4

It renders a fullscreen 1280x1024 texture using a GLCanvas and TextureRenderer. In front of the Java2D stuff theres some simple translucent JOGL rendering going on. The Java2D 'wave' is a simple BufferedImage rendered using pure softwarerendering setting every single pixel by hand (1280x1024 using the CPU). The whole BufferedImage is then tranferred to the GPU every frame (using TextureRenderer) and rendered as simple plane texture in the background. The whole routine runs at ~100+ frames per second on my nearly 3+ year old Core2Duo notebook. And this is all without any DMA/PBuffer/FBO trickery ...

Maybe u could provide some code of what u are actually doing so that we can get a better impression. Seems to me the problem lies somewhere else ...