The Idea
Keep it Easy :)
Okay so the next tutorial in the series went on to talk about textures and how they are applied to polygons. This also introduced a new library for importing the texture data from a file into an OpenGL Texture2D. The library I have decided to use is called SOIL( Simple OpenGL Image Library ). The first part went through how textures relate to OpenGL and the graphics pipeline, which meant starting off with our own predefined values which could then be used for applying as a texture. This is shown below, I created an array of values to represent a black and white texture. After doing this the tutorial then went on to explain how to use the SOIL library. This was fairly simple and once it was implemented allowed for the application of any texture to my rectangle. Below you can see the original rectangle with a funky texture applied to it. Now that I am at this stage the next real step is into the maths part of openGL. I have been through the maths of 3D co-ordinate systems before and instead I am going to jump straight in with a new project that I'm hoping to implement. The IdeaI have decided to integrate a 3rd party model loader into my OpenGL project, which will more than likely be Assimp. This allows for the loading of tons of different file types where as if I implemented my own it would be two or three at most. There is a draw back to this however, as it has such variety then the loading of the models will be fairly slow. Instead of doing this I am hoping to create a converter into binary files that way the Assimp library can be used to get all the data i need for the various types and then I can output this information into a binary file. This means I can use these binary files into my own programs and the load time will be minuscule but will allow for me to use models of different types. This will be a lot of work and I have a lot of other ideas floating round at the moment so I will see how far I get with it. I'm hoping to get to the point where I havw a base project from which to do any sort of OpenGL work from.
Keep it Easy :)
0 Comments
After doing the tutorial on lighthouse3d.com I had a look through some of the tutorials that were for further along and realised that they really took things too slow and also skipped over all the important parts of OpenGL. I had a browse around on the internet and realised that GLUT( the library i was using ) had not been supported for a long time and also was not that great due to its over simplicity. It also did not allow much room for expansion in to shader work. After this all happened I had another look round and found a great tutorial site that takes an in depth look into the shaders and the OpenGL functionality. Although this tutorial still uses a few librarys I have begun to realise that due to the open-source nature of OpenGL that this was going to be the case no matter what. Okay so i'm now following this new tutorial chain on www.open.gl. This website is so simplistic and well written that following it has been extremely simple so far. I have learnt about VBO's and VAO's and all other sorts of OpenGL based objects. This tutorial is taking a little longer as i'm really going over the exact procedures of setting up a window and context to ensure that I'm doing it correctly and efficiently. After the first tutorial you end up with a rectangle with different colours in each corner, like the image below: After doing this tutorial I have learnt a lot about the basics of OpenGL and I can see that it does match DirectX in certain ways except a lot of the terms are changed for example and Element Buffer seems to be the same as an Index Buffer in DirectX.
The next tutorial goes on to explain texturing and then by two or three tutorials we are in the realms of post processing effects. I'm pretty excited to get stuck in, although I will be focusing a little more on the structure of my current program, separating all the functionality into objects and applying some sort of logging system. That way progress should be a little easier. :) |
Archives
May 2020
Categories
All
|