Sign in to follow this  
glober

OpenGL Inspired By The Demoscene: Beginner Starting His Journey In Graphics Programming.. Seeking Advice

Recommended Posts

Hi everyone!

 

So ever since I watched a few youtube videos of demos created by people from the demoscene, I have been fascinated by Graphics Programming. The way it allows us to express our creativity, artistic vision, and at the same time, showcase our programming prowess is something that have made a big impression on me.

 

 However, knowing how ardous this road is, I was hoping if anyone who have taken the plunge into Graphics Programming could share some advice, or point me in the right direction ?

 

I have some programming experience (namely Python) though I wouldn't call myself a very 'experienced' programmer. In addition, I have done majority of the college level math classes in the past: calculus, linear algebra, discrete mathematics- though I'll have to admit, that's largely forgotten by now ^_^

 

From my understanding, I would need to:

 

1. Learn C++:

I will be picking up a book or two on the subject soon, but if anyone have any good suggestions of a book on C++ that they think would be perfect for a beginner please let me know!

 

I know that C++ is one of the more complex languages when it comes to programming and that one never stops learning when it comes to C++ because of the plethora of libraries it has, but for Graphics Programming, what are some of the key programming concepts or area of focus I should pay more attention to while learning C++? And just how much fluency I would need to acquire before I should even attempt to learn about Graphics Programming? (once I have the fundamentals down? once I have reached an intermediate level?)

 

2. Brush up on Linear Algebra and more specifically, have a solid understanding of the use and applications of Vectors and Matrices?    (these seems to be the most important mathematical concepts when it comes to Graphics Programming right? as they are related to transformation and animation.

Are there anything else beside these two? Quaternions? Trigonometry?

   

3. Choose between DirectX or OpenGL

Personally I would probably pick OpenGL as it's crossplatform, so what comes next is understanding the entire openGL pipeline, its libraries, etc? glsl, shaders?

 

 

With so many things yet to learned, and how much depth Graphics Programming actually covers, it truly feels a little daunting.

If you were to advice a novice on how he should get started, what would be the step by step approach you would suggest? What would you recommend him to learn first, second, third.. etc. What learning materials would you recommend?

Share this post


Link to post
Share on other sites

Welcome to the wonderful world of graphics programming! I'll try to answer some of those questions for you.

 

1. Learn C++:

Any language which has access to a well-documented graphics library will do, so you don't necessarily have to go for C++. Honestly, if this is your first experience with programming I'd actually recommend going for something like C#. There's plenty of awesome libraries or wrappers available to do graphics related programming and it'll allow you to get up and running more quickly. It's going to be a while before you can get any real benefit out of working in C++ anyway, so it might be a smaller hurdle to get over by sticking with a more "approachable" language. I know a lot of people have different opinions on this though, so I'll let others add their opinions to this as well.

 

2. Brush up on Linear Algebra and more specifically, have a solid understanding of the use and applications of Vectors and Matrices?

Absolutely! Understanding linear algebra and trigonometry is going to help you out a lot if you want to make any progress. Once you advance a bit further it can become useful to have a good grasp of some elementary concepts in calculus, like differentials and integrals. Once you're at the point where you need those you should have an understanding of the following mathematical concepts you're going to need to advance. It's best not to worry about very complex things for now, just basic linear algebra can already get you far.

 

3. Choose between DirectX or OpenGL Personally I would probably pick OpenGL as it's crossplatform, so what comes next is understanding the entire openGL pipeline, its libraries, etc? glsl, shaders?

The fact that the OpenGL standard is supported on multiple platforms does not mean that it will work out of the box across multiple platforms or even across multiple graphics hardware vendors. OpenGL is notorious for being very inconsistent in these cases. If you're starting out I wouldn't focus on getting things to work on multiple platforms just yet. Start off with one and see how far you get. Worry about the mess that is cross-platform graphics development later.

 

If you want to focus on actually implementing graphical techniques (i.e. you actually want to write code and shaders to get thing to show up on screen asap) I'd actually recommend going with something a little higher level than plain DirectX or OpenGL. I'm a bit out of the loop on publicly available graphics engines, but there's plenty of them out there. I know libraries like Ogre used to be very popular, but I haven't had a look at any of those libraries in years. Even working in Unreal and Unity for experimenting with shaders and such can be a great introduction without too much stuff getting in your way.

I'd recommend looking at OpenGL and DirectX once you understand the needs and requirements of graphical applications a bit better, or if you're just really passionate about having a look at more architectural stuff.

 

The most important thing is to experiment a lot and to not worry about not getting things right immediately. Don't be intimidated by the complex looking math and such. Find sample implementations for things, play around with them, try to understand them and try to connect them mentally to their mathematical description.

 

Good luck!

Share this post


Link to post
Share on other sites

If you are focused on graphics programming, then I would suggest you try a different approach first.

 

It will take you a long time to learn enough to have a graphics framework you can experiment in if you write everything yourself.

 

I would suggest you start by looking at online sites that let you play without having to re-invent the wheel.

 

For example spend some time looking at shadertoy. Look at some of the simpler shaders until you think you understand them. Then change them and see if you are right. You can change the code in the browser and instantly see the effect your changes have had.

 

Once you are comfortable doing that, then you can start looking at what to do next.

Share this post


Link to post
Share on other sites
The most beautyful part of demoscene is, in my opinion, the old demos for ZX Spectrum , C64, and MS-DOS. That old taste is the most genuine for the Spirit of what demoscene really means. With that perspective, it is not a bad idea to use old versions of Allegro libraries (DOS) or SDL, though those are for C. For C++ we have SFML in any version. Of course may be possible to be even more rewarding to do all yourself or with little help from high level libraries, but I reccomend to be fluent in 2D before try 3D. I read very good critics about Pygame, the all famous lib for Python

Share this post


Link to post
Share on other sites

Are you trying to get into the demo scene or real-time video game graphics or offline rendering?

 

Trying to get into the demo scene, what they do is real time rendering via procedural generated graphics i believe.

Share this post


Link to post
Share on other sites

shadertoy looks really awesome. I will definetly play around with that first !

 

In regards to learning a new language, I was planning on learning a new language anyway so I really don't mind spending the extra time.

 

In your opinion, would it be better to start out with C or C++ ? I know C++ and C# are heavily used for game development, but for Demoscene, and Graphics Programming where one actually makes all his stuff, and where efficiency, size and speed are also more of a concern, then C or a Cish C++ is often used right?

 

When looking around online, some people have said that it's better to start out with C as C is a lot smaller in comparison to C++ and is stricter, which makes C a little easier to learn. But, on the other hand, there's also the opinion that starting with C sometimes makes people fall into bad habbits when they do try to write code in C++ as they often fall back to writing in a more C style code. is this true?

 

Lastly, does anyone know of any other Graphics Programming communities or forums? (other than this one of course.)

Edited by glober

Share this post


Link to post
Share on other sites

When looking around online, some people have said that it's better to start out with C as C is a lot smaller in comparison to C++ and is stricter, which makes C a little easier to learn. But, on the other hand, there's also the opinion that starting with C sometimes makes people fall into bad habbits when they do try to write code in C++ as they often fall back to writing in a more C style code. is this true?

 

Being C++ an extension of C, at the core there's really not much difference between both of them... C++ just adds new stuff to the language, abstracts some others and fixes a few little things here and there, to the point that you could almost compile C code on a C++ compiler without problems... so, by learning C you're already learning the basics of C++...

 

Also C makes you think more at the metal level, you could easily figure out the assembly produced by your code in C... and that's good... if you then move to C++ and see how it abstracted some things, you can figure out what's going on on those abstractions (nothing is pure magic), and you can decide if it's good for what you're doing or not...

 

But don't give it too much thought, as long as you understand what's going on with the code you write no matter what you learn first or after... the important thing is to take the next step in your career ;)

Share this post


Link to post
Share on other sites

C - as one of the most popular language in the universe - will be good for you at any production level, but you must find your own favorit programming language to work. 

Share this post


Link to post
Share on other sites

Being C++ an extension of C, at the core there's really not much difference between both of them... C++ just adds new stuff to the language, abstracts some others and fixes a few little things here and there, to the point that you could almost compile C code on a C++ compiler without problems... so, by learning C you're already learning the basics of C++...

 

I really don't want to start a language war here, but this is a very common misconception. C++ is not a superset of C. It might have been at one point a long time ago, but it's absolutely not true anymore these days.

 

There's a ton of difference between C++ and C, learning C does not teach you anything about how to properly write and structure code in C++. If you go into C++ with a C mindset you'll probably just end up writing something that looks like C but with classes.

 

I'm going to leave it at this. It's really not my intention to start a language flame war.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Forum Statistics

    • Total Topics
      627714
    • Total Posts
      2978773
  • Similar Content

    • By DelicateTreeFrog
      Hello! As an exercise for delving into modern OpenGL, I'm creating a simple .obj renderer. I want to support things like varying degrees of specularity, geometry opacity, things like that, on a per-material basis. Different materials can also have different textures. Basic .obj necessities. I've done this in old school OpenGL, but modern OpenGL has its own thing going on, and I'd like to conform as closely to the standards as possible so as to keep the program running correctly, and I'm hoping to avoid picking up bad habits this early on.
      Reading around on the OpenGL Wiki, one tip in particular really stands out to me on this page:
      For something like a renderer for .obj files, this sort of thing seems almost ideal, but according to the wiki, it's a bad idea. Interesting to note!
      So, here's what the plan is so far as far as loading goes:
      Set up a type for materials so that materials can be created and destroyed. They will contain things like diffuse color, diffuse texture, geometry opacity, and so on, for each material in the .mtl file. Since .obj files are conveniently split up by material, I can load different groups of vertices/normals/UVs and triangles into different blocks of data for different models. When it comes to the rendering, I get a bit lost. I can either:
      Between drawing triangle groups, call glUseProgram to use a different shader for that particular geometry (so a unique shader just for the material that is shared by this triangle group). or
      Between drawing triangle groups, call glUniform a few times to adjust different parameters within the "master shader", such as specularity, diffuse color, and geometry opacity. In both cases, I still have to call glBindTexture between drawing triangle groups in order to bind the diffuse texture used by the material, so there doesn't seem to be a way around having the CPU do *something* during the rendering process instead of letting the GPU do everything all at once.
      The second option here seems less cluttered, however. There are less shaders to keep up with while one "master shader" handles it all. I don't have to duplicate any code or compile multiple shaders. Arguably, I could always have the shader program for each material be embedded in the material itself, and be auto-generated upon loading the material from the .mtl file. But this still leads to constantly calling glUseProgram, much more than is probably necessary in order to properly render the .obj. There seem to be a number of differing opinions on if it's okay to use hundreds of shaders or if it's best to just use tens of shaders.
      So, ultimately, what is the "right" way to do this? Does using a "master shader" (or a few variants of one) bog down the system compared to using hundreds of shader programs each dedicated to their own corresponding materials? Keeping in mind that the "master shaders" would have to track these additional uniforms and potentially have numerous branches of ifs, it may be possible that the ifs will lead to additional and unnecessary processing. But would that more expensive than constantly calling glUseProgram to switch shaders, or storing the shaders to begin with?
      With all these angles to consider, it's difficult to come to a conclusion. Both possible methods work, and both seem rather convenient for their own reasons, but which is the most performant? Please help this beginner/dummy understand. Thank you!
    • By JJCDeveloper
      I want to make professional java 3d game with server program and database,packet handling for multiplayer and client-server communicating,maps rendering,models,and stuffs Which aspect of java can I learn and where can I learn java Lwjgl OpenGL rendering Like minecraft and world of tanks
    • By AyeRonTarpas
      A friend of mine and I are making a 2D game engine as a learning experience and to hopefully build upon the experience in the long run.

      -What I'm using:
          C++;. Since im learning this language while in college and its one of the popular language to make games with why not.     Visual Studios; Im using a windows so yea.     SDL or GLFW; was thinking about SDL since i do some research on it where it is catching my interest but i hear SDL is a huge package compared to GLFW, so i may do GLFW to start with as learning since i may get overwhelmed with SDL.  
      -Questions
      Knowing what we want in the engine what should our main focus be in terms of learning. File managements, with headers, functions ect. How can i properly manage files with out confusing myself and my friend when sharing code. Alternative to Visual studios: My friend has a mac and cant properly use Vis studios, is there another alternative to it?  
    • By ferreiradaselva
      Both functions are available since 3.0, and I'm currently using `glMapBuffer()`, which works fine.
      But, I was wondering if anyone has experienced advantage in using `glMapBufferRange()`, which allows to specify the range of the mapped buffer. Could this be only a safety measure or does it improve performance?
      Note: I'm not asking about glBufferSubData()/glBufferData. Those two are irrelevant in this case.
    • By xhcao
      Before using void glBindImageTexture(    GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format), does need to make sure that texture is completeness. 
  • Popular Now