Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 12 of 12 FirstFirst ... 2101112
Results 111 to 120 of 120

Thread: Display lists in 3.1

  1. #111
    Intern Newbie
    Join Date
    Jan 2010
    Location
    Linköping, Sweden
    Posts
    46
    Quote Originally Posted by thokra View Post
    Using buffers maybe confusing to the beginner at first but that isn't due to Java or any other language. If one doesn't know how computer memory is organized and what addressing means then that's a general shortcoming that will prove to be an obstacle with a lot of other stuff as well, not only OpenGL. Aside from that, there are much more complex things out there than pointers. If you loose students after the first course because using buffers is too hard ... that's not OpenGL's fault.
    Yes it is, since OpenGL has become harder to get started with. With Immediate Mode, you can write simple beginner's OpenGL programs that just can't crash. That gives the students a safe and comfortable start, and a "draft mode" to work from. That has a point. We used to start with that in the first lab, and then continue with glDrawElements in the second to move them to better performing OpenGL.

    With OpenGL 3.2, we use VAOs and shaders, and the result is all too often that the students get a blank screen, or a crash, even on the very first exercises. I have to question whether that is really the right way to teach CG.

    We still have taken the step, I have rewritten my lectures, labs and course book to be 100% OpenGL 3.2, and most students seem to like the move. So far so good, so I am not trying to stay with the old way. But I must evaluate what we did, and I am questioning how to get started in a really smooth and nice way. There is room for improvement.
    Please, please explain to me how supporting display lists, which is basically a collection of GL commands that can be executed together at an arbitrary point of run-time, is equal to supporting a totally unrelated, platform dependent graphics file format. I really don't get it.
    To me it is totally obvious, because formats like PICT, EMF and PDF are both, they work exactly like display lists when in memory, but can also be on disk. They are all collections of graphics commands. Display lists are the only way I know to do the in-memory part in OpenGL, and if I could extract the contents it could (with some effort and maybe some limitations) be translated to any of these file formats.

    I ran into this when translating graphics code relying on metafiles both for in-memory recording of graphics sequences as well as storage. I want to make an OpenGL layer, and with display lists I have a part of it. I suppose the whole problem has to be solved on a higher level (sounds pretty complex), but I fear that I will lose performance.

  2. #112
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,948
    That gives the students a safe and comfortable start, and a "draft mode" to work from.
    While simultaneously giving them the illusion that they have even the slightest idea of what's going on with their code. A hefty percentage of questions on this site come from people who think they know what they're doing, thanks to immediate mode and NeHe's tutorials.

    I've always been of the belief that learning things the wrong way is potentially dangerous. It may be more complicated initially, but it will be a lot smoother going once you get into the real course work (lighting, textures, etc).

    If you want them to have a "draft mode" to start from, then give them working code to begin with. Having them write the boilerplate initially serves little purpose.

  3. #113
    Intern Newbie
    Join Date
    Jan 2010
    Location
    Linköping, Sweden
    Posts
    46
    Quote Originally Posted by Alfonse Reinheart View Post
    While simultaneously giving them the illusion that they have even the slightest idea of what's going on with their code. A hefty percentage of questions on this site come from people who think they know what they're doing, thanks to immediate mode and NeHe's tutorials.

    I've always been of the belief that learning things the wrong way is potentially dangerous. It may be more complicated initially, but it will be a lot smoother going once you get into the real course work (lighting, textures, etc).

    If you want them to have a "draft mode" to start from, then give them working code to begin with. Having them write the boilerplate initially serves little purpose.
    We already are giving them working code to start from. And that is why we left Immediate Mode in the first place, to get straight into high performance modern code. And that is also why we turned to glDrawElements at lab 2 even when using GL 2, to make sure they know what they are doing, to get them on the right track as early as possible.

    At my very first lecture, a working example with shaders and VAOs is presented (and run, live). But then I have to hide quite a bit of code, namely the shader upload/compiling, otherwise that example is scary. And it takes time until they know what it all means. Comparing the complete minimal 3.2 program to the minimal 2.1 program is pretty horrible.

    We can note that as late as the 7th edition (2010), the Red Book starts with Immediate Mode (page 6). Why? Is that just laziness?

  4. #114
    Member Regular Contributor
    Join Date
    Jan 2012
    Location
    Germany
    Posts
    325
    Quote Originally Posted by Ragnemalm View Post
    We can note that as late as the 7th edition (2010), the Red Book starts with Immediate Mode (page 6).
    I don't recommend the Red Book anymore because of this (and some other problems).

    Quote Originally Posted by Ragnemalm View Post
    Why? Is that just laziness?
    Either that or they hope as well that teaching outdated stuff first and hopeing the audience will forget it later on is a good idea.
    If you teach OpenGL, teach 3.2 core (this way also the Mac users can work on there own machines).

    Sure, writing everything from scratch is too much for beginners. Give them code to load shaders, give them the shaders, give them a drawCube() and drawSphere() function and let them set colors and matrices via uniforms until they know the basics of transformations. You don't need immediate mode for teaching anymore.

    If you want them to define vertices and triangles and don't care about the rest, let them fill an array and provide a drawTriangleArray( float* data, int numberOfVertices ) - at least, this is how GPUs work: you give them data and let them draw everything at once, not vertex by vertex.

  5. #115
    Senior Member OpenGL Pro
    Join Date
    Apr 2010
    Location
    Germany
    Posts
    1,128
    We can note that as late as the 7th edition (2010), the Red Book starts with Immediate Mode (page 6). Why? Is that just laziness?
    The book refers to OpenGL 3.0 and 3.1. I guess the idea was, since OpenGL 3.0 only deprecated but didn't remove features they deemed immediate mode stuff still worthy of being included.

    I guess the 8th edition will fix that. No idea why that one doesn't include the changes for GL 4.2. One might think they had enough time.

  6. #116
    Junior Member Regular Contributor
    Join Date
    May 2012
    Posts
    100
    No idea why that one doesn't include the changes for GL 4.2. One might think they had enough time.
    Maybe that's why the delay in releasing the book, is to include 4.2 changes.

  7. #117
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,948
    At my very first lecture, a working example with shaders and VAOs is presented (and run, live).
    Pardon me for criticizing your teaching methods, but why would you be showing a code example in your first lecture? Admittedly, it has been a while since I took a course in CG, but I seem to recall that our first lectures were on graphics theory. Actual source code took a while.

  8. #118
    Senior Member OpenGL Pro
    Join Date
    Apr 2010
    Location
    Germany
    Posts
    1,128
    [..]but I seem to recall that our first lectures were on graphics theory.
    Same here. We hit it hard with some pounds of Peter Shirley.

  9. #119
    Senior Member OpenGL Pro Aleksandar's Avatar
    Join Date
    Jul 2009
    Posts
    1,136
    Hey guys, how about moving discussion to another thread? All stuff now relates to teaching OpenGL and have nothing in common with display lists.

    Teaching graphics is really interesting topics. Since 2004 I've been thinking of switching to pure shader based OpenGL course as a part of Computer Graphics course on undergraduate studies, but until now nothing is changed. I've been discourage by my coleagues, suggesting that shader based aproach is complicated for that kind of course. Even with immediate mode rendering it is pretty hard for students to do everything I give them for lab exercises. Since this is the first and only CG course, there are a lot of concepts they have to accept.

    As you've probably noticed, I want to do everything by myself, and that's the policy I imposed to my students in order to make them understand what's really happening under the hood. Writting a framework for dealing with shaders is not a simple task. But if I do it for them, they'll probably copy that framewor for other projects as being ultimate solution, which is certainly not. We have to give students knowledge how to use OpenGL not certain home-built framework.

  10. #120
    Intern Newbie
    Join Date
    Jan 2010
    Location
    Linköping, Sweden
    Posts
    46
    Quote Originally Posted by Aleksandar View Post
    Hey guys, how about moving discussion to another thread? All stuff now relates to teaching OpenGL and have nothing in common with display lists.

    Teaching graphics is really interesting topics. Since 2004 I've been thinking of switching to pure shader based OpenGL course as a part of Computer Graphics course on undergraduate studies, but until now nothing is changed. I've been discourage by my coleagues, suggesting that shader based aproach is complicated for that kind of course. Even with immediate mode rendering it is pretty hard for students to do everything I give them for lab exercises. Since this is the first and only CG course, there are a lot of concepts they have to accept.

    As you've probably noticed, I want to do everything by myself, and that's the policy I imposed to my students in order to make them understand what's really happening under the hood. Writting a framework for dealing with shaders is not a simple task. But if I do it for them, they'll probably copy that framewor for other projects as being ultimate solution, which is certainly not. We have to give students knowledge how to use OpenGL not certain home-built framework.
    You are absolutely right. My initial problem when finding the thread remains, namely that I feel a need for metafile support like display lists (not least since all other APIs have it) and how I could possibly replace it in 3.2+ (using no deprecated calls), but the teaching part is not entirely relevant, but certainly interesting and important.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •