We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOpenGL and 3D Libraries › framereate drops to 9-15fps
Page Index Toggle Pages: 1
framereate drops to 9-15fps (Read 824 times)
framereate drops to 9-15fps
Jul 17th, 2009, 3:19am
 
Hi, I have no knowlegde of opengl, but I need to use it because the way P3D renders the texture using beginshape doesnt look good.


So my sketch is running fine at 60fps using OPENGL, but when I add some loadPixel funcitons it drops sharply to 9fps, I read on a post that using get, loadpixels and those methods alike with opengl makes the sketch runs very slowly but it doesnt get into details as why.

So if that is the case what can I do?, is there any other way to workaround this?

Any help will be much appreciated!

Cheers
rS
Re: framereate drops to 9-15fps
Reply #1 - Jul 17th, 2009, 10:22am
 
Could you post some of your code, so I can test different methods?
Re: framereate drops to 9-15fps
Reply #2 - Jul 18th, 2009, 6:34am
 
loadPixels() is slow because it causes pixels from either the OpenGL framebuffer or texture memory (depending on where you are calling it) to be copied from the graphics card to the CPU. Those pixels then need to be put back after you're done modifying them. Graphics card are not particularly good at doing that sort of transfers. This is a slow operation that is proportional to the number of pixels that need to be moved: the higher the resolution you are working with, the slower it will be.

As for workarounds, that really depends on what you're trying to do exactly.

d.
Page Index Toggle Pages: 1