User Tag List

Results 1 to 3 of 3

Thread: How does Open GL work?

  1. #1
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module
    Ethan's Avatar
    Join Date
    Apr 2010
    Fort Worth, TX
    0 Post(s)
    0 Thread(s)

    How does Open GL work?

    I want to start working with 3d graphics, but first I need a dummies tutorial for Open GL.

  2. #2
    Clickteam Clickteam
    Anders's Avatar
    Join Date
    Jun 2006
    Denmark, ┼rhus
    2 Post(s)
    0 Thread(s)

    Re: How does Open GL work?

    Nobody can give a meaningful short tutorial of OpenGL but I will try to outline the concepts:

    OpenGL is not a 3D engine:
    It is so general that it can do LOTS of things. 3D is just one of them because it is so general. Being able to do 3D in OpenGL is not something you just do.

    You need to know some of the math:
    You will benefit from being familiar with translating, rotating and projecting vertices onto the screen from a 3D coordinate system. You *can* get away with just following a tutorial to set up the math in OpenGL to draw a simple 3D object but you wouldn't know where to start if you want to change anything otherwise.
    In most 3D cases you have every object in world coordinates, you have them translated into viewspace (coordinates relative to the camera), and then have it all rotated. You do this by doing matrix multiplications. In the desktop OpenGL versions you have a somewhat easy method of doing the matrices but in future versions of OpenGL all that will be gone in the name of "generality". OpenGL for mobile devices doesn't have that for example so you need to implement all the math yourself including multiplying matrices and "uploading" them to the graphics card to work inside a vertex shader.
    For the OpenGL extension you can probably use some easier to use actions to set up an easy game rendering system (like setting up a projection-matrix and so on)

    OpenGL is a state-machine:
    In short: Whenever you change anything it will stay that way until you change it again manually. If you set the current texture, everything you draw will use that texture until you change it again. That means you need to change many settings before you draw every object including which vertices you want to draw, how to move them, rotate them, scale them, texture and shader + shader uniforms if the shader needs them.

    You need to do everything yourself:
    OpenGL doesn't come with loads of easy-to-use features. If you want to do something specific, chances are that you need to do it all yourself. Want add lighting? You need to do a lot of vector math in the pixel/vertex shader to shade the pixels so it looks like they are affected by light.
    Want to add soft shadows? You need to implement framebuffers with a depth-texture attached to make a render-to-texture system, then being able to draw the world into that buffer from the viewpoint of the light source, then in the normal rendering pass attach a shadow shader to everything while in it you need to transform the coordinates of the fragment you are drawing from viewspace into the light-space to compare depth and distance values (lots of matrix math involved) before you can determine if a fragment is in shadow or not.

    In general if you only want to do some simple 3D stuff, it isn't worth trying to make a 3D engine yourself as it takes quite a lot of work to make one. I know, I tried it ;-)

  3. #3
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Aug 2006
    0 Post(s)
    0 Thread(s)

    Re: How does Open GL work?

    I find the collection of objects very easy to use although i guess i would be considered a advanced user of MMF2. The OpenGL Collection should include various examples so you should take a look at those.

    As Andos says it all depends on what you want to do really. If you want to use the collection objects it is basically just like using regular extensions but you need to know the basics of 3D still and that would be the simplest option.

    If you want to code OpenGL with XLua though you would have to learn both of these and then also the XLua method for OpenGL which is very similar but has a few differences. Lua coding is probably the simplest type of coding there is though and both Lua and OpenGL have many tutorials available online.

    Coding will allow you to make far more complex projects though but it's not really for beginners. The object collection had the aim of making it very simple to make 3d but i haven't seen any news on them for a while now, hopefully they are still in development though.

Similar Threads

  1. open gl
    By TheCrimsonTaco in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 11th December 2013, 08:08 PM
  2. Open URLs don't work
    By 2ndreality in forum SWF/Flash Export Module Version 2.0
    Replies: 3
    Last Post: 15th November 2012, 01:52 PM
  3. Replies: 7
    Last Post: 20th December 2011, 07:27 PM
  4. The Big Box ext. vs. Vista, does Open a file work?
    By Tiles in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 28th November 2008, 10:59 AM
  5. Problem: Open a group to open all sub groups?
    By Nifflas in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 14th August 2006, 08:41 PM

Posting Permissions

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