-
Waterfall Display
Hello,
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!!
-James
-
Super Moderator
OpenGL Lord
Re: Waterfall Display
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 256*256), reusing the 8*6 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 ?
-
Senior Member
OpenGL Pro
Re: Waterfall Display
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.
-
Advanced Member
Frequent Contributor
Re: Waterfall Display
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.
-
Senior Member
OpenGL Pro
Re: Waterfall Display
Well, he asked about "waterfall display" not "waterfall" 
Waterfall display is simply put a window that scrolls vertically above continous image (a stream of data).
-
Advanced Member
Frequent Contributor
Re: Waterfall Display
ups. understand now. thanks for correction k_szczech. something new every day.
-
Re: Waterfall Display
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?
-
Senior Member
OpenGL Guru
Re: Waterfall Display
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.
-
Re: Waterfall Display
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.
-
Re: Waterfall Display
Can you send me the an concrete example for this WaterFall..
Thank you
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules