Waterfall Display


Sorry I needed help in figuring out how to create a “waterfall display”. It basically takes in a 2 dimensional array of 8bit pixels and displays it streaming down the screen. This data is just 8bit pixels and keeps streaming down my display (1600x1200).

I’ve implemented this using QT but it the PaintEvent() which gets called to refresh the image each time is too slow in scrolling the data down the screen.

I was wondering would the best solution be to generate a texture out of the 8bit pixels using opengl? Also, would I need to generate multiple textures of each line of data that comes in?

Or can somebody please help me figure out what’s the best solution?

Thank you!!

You mean currently, you use glDrawPixels ? This is not really fast indeed.

Not sure if using 1200 1D textures would be efficient.
To me the best would be to split background in textured quads (for example size 256256), reusing the 86 different textures : as soon as block is falls out of the view, glTexSubImage it with the next upper block.
Ideally you should implement both ways and benchmark to find the best.

About the repaint, I don’t know Qt enough, is there something like the GLUT Idle Callback, to repaint screen continuously ?

I’d use a single rectangular texture that is exactly as big as the screen.
Each time you just update texture coordinates to scroll the image and update one or more rows (that got wrapped around in current frame) with new data using single glTexSubImage2D call.

a waterfall could be just a plane rendered with 2 triangles where seamless texture is applied to move the water in v direction with a texture matrix or shader. i believe this would not look cutting edge style.

Well, he asked about “waterfall display” not “waterfall” :slight_smile:
Waterfall display is simply put a window that scrolls vertically above continous image (a stream of data).

ups. understand now. thanks for correction k_szczech. something new every day.

Wow thanks guys for responding so quickly!

k_szczech, that’s what I was originally thinking about doing. I just wanted to make sure that this is the correct approach in opengl and that it’s possible (b/c I’m completely new to opengl).

ZbufferR, your approach is basically the same except I’m using blocks of textures right? (I don’t really understand your comment about reusing the 8*6 different textures). Anyways, using this method, wouldn’t I need to wait for (i.e.256) lines of data to come in before I can update the display?

Thanks again for your replies. Now I just need to figure out how to create texture from the char buffer where the 8bit pixels are coming in.

indeed, k_szczech wrote the best solution :slight_smile:

I’m trying to do the same thing but I’m not clear about the suggested approach from k_szczech.

Currently I am able to fill in the next row of data from my texture as new updates come in but I’m not actually scrolling the old data down the screen. Changing the texture coordinates doesn’t really make sense to me.

Can someone give a little more of a concrete example?

to get your waterfall looking much nicer an easy method
is to have 2 textures drawn blended over each other
have them scroll down in the water direction but also have one slowly scroll left + the other slowly scrolling right.

I believe you’re thinking of an actual waterfall visual. I’m talking about getting a new set of pixels every second, moving the existing texture down by 1 pixel, and putting the new pixels at the newly vacated spot at the top of the texture. Or another approach like the one that was discusses above but I don’t understand.

Can any one help me out the same by any set of examples(code)…
I have to refresh the display at the milli second level…
i.e my data comes at the rate of 1 milli sec and i have to present it on the WaterFall Display …

@NaveenKumarPuli: the solution

You cannot update at 1ms, you are limited by the display rate.

You have not explained what you want to draw.

Thank you for the Response. But i have said earlier that i am new to OpenGl… But still i tried to read out the solution which i did not understand. Can you suggest me with some examples code.

Detail Description of my kind of work.
Operating System: Windows-XP. Language: C++. IDE=Visual Studio-2005(VC++), Using both wxWidgets 2.8.9 and OpenGl.
Data Recvied: Data is received from network at the rate of 1ms.Data size if of 1600… Which i have to display each pixel as one data and color it accoring to value in it.
Display : I have to display the data in WaterFall Display Model.
WaterFall Display: If (0,0) is taken as on top left corner of the screen, First data will be displayed on the 0 row.
When Second data comes, it should be displayed on the Zero row and the previous data should be displayed in the 1st row. In this way, as the data comes I have display it on the top and the previous ones should be slided down.
So, This data should be shown in a scrollable manner and upto 3000 inputs and then scrolling down.
Till now i Have developed a screen by using wxFrame(1280x1024). On that a wxPanel(1000x700) is taken and then wxGLCanvas(1000,700). and But from here i am not able to proceed.
Need of great help

Can any one suggest me some ideas of displaying the data in the WaterFall Display…

already done.

Hi Cranson, Did you get the scrolling of old data down the screen?
if yes can you help me out to do so…

Can you send me the an concrete example for this WaterFall…

Thank you