Re: [PyOpenGL-Users] Rolling spectrogram with pyopengl
Brought to you by:
mcfletch
From: Timothée L. <tim...@lp...> - 2009-12-06 12:26:40
|
Le 4 déc. 09 à 00:38, Ian Mallett a écrit : > Hi, > > I would definitely use a shader. You can render the screen to a > texture every frame, then simply draw the texture offset by one > texel in the shader. The new data can just be added on. You could > use FBOs for even greater speed, although you'd need ping-ponging. > > You could also simply draw the texture offset by one, which I think > is what you're doing. It's probably better to use > glCopyTexSubImage2D or something. > > What sort of speed do you need? All of these should run at least as > fast as the refresh rate . . . > > Ian Hi Ian, I precisely need it to run as fast as the refresh rate, and it already is running fast enough, either with opengl or with pure 2D. However, it burns too much CPU to my taste, since the drawing part takes more time than the processing part, although the latter is quite heavy (FFT...), so I think there is room for large improvements. As you rightly say, I am drawing the texture off by one. As far as alternatives to pure glTexSubImage2D, I have considered and tried to use PBO, but it does not decrease the time needed by the two glTexSubImage2D calls. I don't really see how I could use glCopyTexSubImage2D instead of glTexSubImage2D. Finally, if I use a shader, how can the two columns of data can be transferred to it ? Will it be faster than a call to glTexSubImage2D, with or without PBO ? Thanks for your kind help, Timothée |