Frame buffer question!


#1

Hello, i just had a question about framebuffers…

I’ve read a lot about it in the OpenGL documentation and i do understand what it is, but what i don’t understand is how i can acces it and what i can acces in the framebuffer.

I tried to search google for it and went through my books but they don’t tell me anything.
Do i have to be concerned about this issue as a graphics programmer ?

Does anyone has some recent information about framebuffers ?
And is every framebuffer on every videocard the same, is it accessed the same way and does it need specific configurations for each type of videocard ?

And last but not least, is framebuffer handling the same on every platform like Windows and Linux, MacOS, or does a programmer needs to specify different settings for different OS types ?

btw, ther are only 2 threads with the word ‘framebuffer’ in it on CGtalk, maybe we could talk about this so people who come here and search for it actually get some good information, or is there nothing really to talk about :-), sorry i’ve just started in graphics programming so please excuse my ignorrance!

cheers,
Galo


#2

Hi,

Basically, the framebuffer in OpenGL is the pixels of the final rendered image. To get a better understanding of what OpenGL works like see:

OpenGL Programming Guide: The Official Guide to Learning OpenGL, Version 1.4, Fourth Edition
http://www.amazon.com/exec/obidos/tg/detail/-/0321173481/qid=1100704224/sr=8-1/ref=pd_csp_1/104-4369035-8022368?v=glance&s=books&n=507846

Links

OpenGL.org - http://www.opengl.org

Also try: http://nehe.gamedev.net/ it has a lot of good tutorials on starting up with OpenGL.

>And last but not least, is framebuffer handling the same on every platform like Windows and
>Linux, MacOS, or does a programmer needs to specify different settings for different OS
>types ?

OpenGL is an OS independant library, operations for working on pixels in the framebuffer are the same on all OS’s (…except for some OpenGL extensions which are specific for different hardware platforms…).

-mk-


#3

If you want to modify the “real” frame buffer, it’s different on hardware platforms, nothing to do with OS. So on PC hardware the memory address of your video FB may be different from the address on a Mac computer. You could write directly into video memory (the frame buffer) but it’s dangerous.

The “frame buffer” concept behind OpenGL is OS and hardware independent. It’s just an offscreen memory buffer that is written to and then copied into the hardware frame buffer and that’s when it’s actually displayed on screen.

When you work in OpenGL you shouldn’t be too concerned about the frame buffer. You should be more concerned with the actual 3D space (unless you’re doing accelerated 2D sprites than 3D space isn’t really important). OpenGL has it’s own set of commands that you will learn once you start the OpenGL programming tutorials.

http://nehe.gamedev.net/


#4

Mk, thanks for the advice, ATM im reading the OPENGL 2.0 specification documents from opengl.org, and for someone who has never programmed OGL before it’s good to know a thing or two before you actually begin coding i think.

Yes, i could start @ nehe, which i have visited but not preformed cause i want to get inside information on the GL before i start so i actually know what im doing instead of just doing what a tutorial tells you to.

You awnsered my question loud and clear, thanks for that!

If you want to modify the “real” frame buffer, it’s different on hardware platforms, nothing to do with OS. So on PC hardware the memory address of your video FB may be different from the address on a Mac computer. You could write directly into video memory (the frame buffer) but it’s dangerous.

The “frame buffer” concept behind OpenGL is OS and hardware independent. It’s just an offscreen memory buffer that is written to and then copied into the hardware frame buffer and that’s when it’s actually displayed on screen.

When you work in OpenGL you shouldn’t be too concerned about the frame buffer. You should be more concerned with the actual 3D space (unless you’re doing accelerated 2D sprites than 3D space isn’t really important). OpenGL has it’s own set of commands that you will learn once you start the OpenGL programming tutorials.

Thanks for the input, which brought me with a new question for you, if the FB is different on hardware platforms, the adress to it is as well, is there any kind of standard for this, or specifications ?

Thanks for the help guys,

Galo


#5

Do a search for “VESA” or “VGA” and you’ll find resources for those graphics standards. But that only covers primitive display modes. OpenGL is a framework that composites a scene off-screen whereas VESA or VGA programming is writing directly to the pixels on your screen. Popular back in the early days of game programming but now-a-days developers rely on graphics engines, even for 2D sprite games.


#6

Galo,

What exactly would you like to do with the framebuffer? Save it represented as an image on disk? Modify it? Something else? The framebuffer in OGL CAN be accessed through OS independant methods (calls in OGL) which ARE the same on all platforms (if you only want to read a OGL framebuffer there’s no reason to dive into hardware dependant code).

Anyway, to get a good idea of what OGL is like, try write some small applications, you could use GLUT to avoid all widget management and initializitation code. This will definitly make it easier to understand what you can do with OGL and what it works like as a library.

-mk-


#7

Hey,

The thing is i don’t want to do anything with it yet, but as far as it goes for knowledge a programmer can’t know enough.
As far as working with GLUT, IMHO it’s a tool to make things easier for programmers which is good, but in my case i do like to study the insights of graphics programming and would like to gather as much information as needed on how graphics are handled by hardware and software.

I think it just makes things a little more intresting and easier for me when i know how the hardware communicates with the software and visa versa.

I’ve also read about the fact that the GL has to been seen as a server and you’re software as a client that communicates with the server so i do think that it’s important to know how this is done.

And i could use GLUT to avoid all widget management and initializitation code, but i would also get used to it and miss out on all the important stuff on which graphics programming is all about.

Do a search for “VESA” or “VGA” and you’ll find resources for those graphics standards. But that only covers primitive display modes. OpenGL is a framework that composites a scene off-screen whereas VESA or VGA programming is writing directly to the pixels on your screen. Popular back in the early days of game programming but now-a-days developers rely on graphics engines, even for 2D sprite games.

This is exactly why i posted my question here, so if i understand it right i should move on and leave this issue alone since it’s not important to a programmer anymore nowadays.

Does this mean that the OGL covers this issue, does it handle framebuffer issues for u ?

The documentations tell me that OGL is a set of commads that allow the specifications of geometric objects in two or three dimensions, together with commands that control how these objects are rendered into the framebuffer.

So this means that whenever i make a call to the framebuffer it actually shows immediatly what you’re calling for or do i still have to ask the OGL interface to render it for me ?

Sorry if you don’t understand my question, i just like to get as much information as i think is needed.

Anyway, i think i get the point and don’t have to worry about framebuffers no more but instead look at how i can actually make a box rotate in a OGL environment.

Thanks so much guys i really appreciate it,
Cheers,
Galo


#8

ok, good, you are right if you want to get into the “details” you should probably not use GLUT :slight_smile:

I recommend (for OGL):

OpenGL Programming Guide: The Official Guide to Learning OpenGL, Version 1.4, Fourth Edition
http://www.amazon.com/exec/obidos/t…=books&n=507846

Read through the first chapters about what OGL works like and how things flow through the geometric pipeline before it shows up in the framebuffer, this will definitly get you an in-depth view of whats going on. It will also be a good foundation when moving on to other topics …

Ciao!

-mk-


#9

Just in case you’re looking for a little more information about the framebuffer.
As other people have mentioned, the framebuffer used to just be an address in memory that stored the actual pixels that were being displayed on the screen. It’s not that simple any more.

OpenGL is a spec, and allows some flexibility in the implementation. You mentioned before about reading that it’s a client-server system. One of the main benefits of that is to allow the flexibility in the implementation of the rendering - everything runs through the API. So, you have some implementations that run on the CPU. Others run on the GPU. Others run across a network. But the individual programs don’t have to be concerned with those details.

There is a function called glReadPixels that you can use to query the framebuffer. This method is typically slow, because communication is optimized to the server, not from it. It can be useful for screen captures though.

Oh, in terms of learning OpenGL, I also have a few suggestions. Search for “OpenGL red book” and “OpenGL blue book” - they’re the reference and learning guide books, respectively. There is fulltext available on the web, although it’s usually for an older version of OpenGL. For learning, they’re sufficient.

I’d also suggest Nate Robins’ excellent OpenGL tutors. When I took an OpenGL course at siggraph, they used his tutors to get things going quickly. One cool thing is a side-by-side view of code, and the results of the code - then you can click and drag to change the values of the parameters, and the results change in real-time… very cool. :slight_smile:


#10

Hey there, thanks for the advice i will certainly read those books after i finished this specification which is really good to my oppinion.

Anyway i downloaded the Apps from openGL tutors, looked into the code and even i understand, this is verry well programmed and structured, thanks a milion this is gonna help me big time i know for sure.

I’ve heard about the Sigraph courses, do they have some old ones online that you know off ?

Thanks again,
Galo


#11

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.