[Clam-devel] KeySpace speed up

David García Garzón dgarcia at iua.upf.edu
Thu Jun 7 10:05:44 PDT 2007


With the help of Gonzalez bross (Sergio and Eduard) i speeded up a lot the 
render of the KeySpace view. KeySpace is no more the visualization bottle 
neck.

My poor previous implementation rendered a lot of small polygons (of several 
pixels) and assigned colors to each one, Each polygon was sent vertex to 
vertex. This had a lot of Graphic system overhead.

Now i just build a texture with the color of selected points (matching the 
previous polygons) and we just render a big rectangular square with such 
texture applied. Even the original pixelated look can be obtained now by free 
by not interpolating the texture.

The result is impressive, even without HW acceleration now i can display 
several KeySpaces of several sizes with a minor impact on the frame rate and 
the audio playback.

The mandatory screenshot:
http://iua-share.upf.edu/wikis/clam/index.php/Development_screenshots

Bennett, some ideas to you: 

This same idea can be used in the future to speed up the current vmqt4 
SpecgramRenderer as it also builds the image by using a lot of small colored 
polygons that can be turned into a texture.

An scrolling Spectrogram for the NetworkEditor is also very easy. It just has 
to write a single column of the texture with the incoming frame data and then 
apply the texture with an offset. When texture coords go beyond 1.0 Graphic 
hw takes the texels from the begining at 0.0 so we can write it as a circular 
buffer with no fuss to the OpenGL system.

Are you familiar with OpenGL? If not, we could get a talk on the irc. Once you 
have a reference implementation such as KeySpace, it is not as complicated.

David.





More information about the clam-devel mailing list