How does Open GL work?

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • 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 ;)

    Please login to see this picture. Please login to see this link. - Please login to see this picture.

  • 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.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!