Creating a Skybox Using C++, Qt and OpenGL

Skyboxes are commonly used in video games to create a realistic and wide sense of environment. In addition, they can be used to display 360 degree panoramic images, which is the reason why Computer Vision enthusiasts like myself are interested in this topic. To create a Skybox, you need a set of 6 images that correspond to the 6 sides of a cube. In this tutorial, we’ll learn how to create a Skybox using Qt with OpenGL.

Continue reading “Creating a Skybox Using C++, Qt and OpenGL”

Using OpenGL in Qt for Processing Images

Utilizing the power of the GPU, and OpenGL in particular, for Computer Vision and Image Processing purposes has always been a favorite topic of mine. It’s quite easy to find many examples around (even among official Qt example projects) to deal with and learn more about this topic but I figured there are no clear and step by step examples for people who are absolutely new to it. This post aims to cover a number of topics, including the following, in a step by step and simple manner:

  • How to use QOffscreenSurface class for off-screen rendering using OpenGL
  • How to use QOpenGLFramebufferObject to create Frame Buffer objects
  • How to use Vertex Shaders to perform Geometric Image Transformations
  • How to use Fragment Shaders to perform Image Filtering and per-pixel operations
  • How to convert a texture to QImage
Continue reading “Using OpenGL in Qt for Processing Images”

Diffuse Shading in OpenGL Using Qt

This one is taken from one of my favourite books (OpenGL 4.0 Shading Language Cookbook) and the relevant chapter’s title for this tutorial in the book is called “Implementing diffuse, per-vertex shading with a single point light source”. Of course it’s modified to use OpenGL ES in Qt which is more cross-platform and creates less issues with building and running on different operating systems (including Android and iOS)

Continue reading “Diffuse Shading in OpenGL Using Qt”

How to Read Wavefront OBJ Files Using C++/Qt

First of all let’s briefly go through what’s an OBJ File. Here’s a very brief description from Wikipedia: “OBJ (or .OBJ) is a geometry definition file format first developed by Wavefront Technologies for its Advanced Visualizer animation package. The file format is open and has been adopted by other 3D graphics application vendors.” Anyway, I’ll assume that now that since you’re here you already know what an OBJ File is and How and Where to use it.

Continue reading “How to Read Wavefront OBJ Files Using C++/Qt”

Hello Qt, Hello OpenGL, Hello World

The example project that I am going to share in this post is the absolute beginner guide version of using OpenGL in Qt (Specially Qt5 and latest versions of OpenGL) which to my surprise I could not find anywhere. By checking the existing OpenGL examples in Qt I noticed they all make some assumptions about what you know about OpenGL and then go ahead and describe how to use in in Qt. [I hope, I really do] that is not what you’ll find here. So without further ado here is the most simple example.

Continue reading “Hello Qt, Hello OpenGL, Hello World”