May 18, 2016  •  By John Stone  •  OpenGL, Assimp
Hello and welcome back.   This is the follow-on to our original article by Eric Stone,  "Qt and OpenGL: Loading a 3D Model with Open Asset Import Library (ASSIMP)." Last time we covered how to use ASSIMP to load a model into our data structures such that is was ready for rendering with OpenGL.  This time, we’re going to cover how to write a program to actually render these models. We’re obviously going to Qt as our platform layer (it’s in this blog’s title) but we’re going to choose QOpenGLWindow from among all the various ways you can integrate OpenGL with Qt....
April 14, 2016  •  By John Stone  •  OpenGL, Qt, 3D rendering
Welcome back! Last time we talked about texturing, lighting and geometry in regards to porting fixed function OpenGL to Modern OpenGL and while it covered the basic features in OpenGL programs, it left out a lot of advanced techniques that your fixed-function code may have used.  In this article I’m going to talk about one of those advanced features, render-to-texture. Render-to-Texture Render to texture is used in a variety of graphical techniques including shadow mapping, multi-pass rendering and other advanced visual effects.  It involves taking the...
March 14, 2016  •  By John Stone  •  OpenGL, Qt, 3D, 3D rendering
The code referenced in this blog is available here. Texturing Texture setup in modern OpenGL is nearly equivalent to what you are used to in the fixed-function API.  You still have to enable your texture units, create and configure your texture objects (including mipmap chains), upload texture data to them, bind them to a texture target and configure texture coordinates on your vertices as attribute data. However, glTexEnv, glTexGen and the texture matrix stack have been removed. glTexEnv must be replaced by code in the fragment shader.  Recall that a fragment...
February 29, 2016  •  By John Stone  •  OpenGL, Qt, 3D, 3D rendering
The code referenced in this blog is available here. In our last blog, we re-implemented the famous OpenGL triangle in world space and compared and contrasted the fixed-function GLUT program with an equivalent Modern OpenGL program.  We covered how to use Qt's math functions to replace the matrix mode that was removed from Fixed-Function OpenGL and replaced with code you write in your vertex shader.   We talked about the Model, View, Projection idioms and how you can use uniforms to pass these variables (and others) to your shaders programs between draw...
February 18, 2016  •  By John Stone  •  OpenGL, Qt, 3D, 3D rendering
The code referenced in this blog is available here. This is the second of a four part blog series, in which we compare and contrast Fixed-Function OpenGL with Modern OpenGL and introduce you to the issues involved in porting your code to Modern OpenGL. Last time we covered the necessary steps you need to create the famous OpenGL triangle with the modern API.  We've introduced shaders and described their inputs and outputs along with various Qt convenience objects that make working with the new modern API easier.   In Part 2, we move from clip...
February 9, 2016  •  By John Stone  •  OpenGL, Qt, 3D, 3D rendering
The code referenced in this blog is available here. In this first of a four part blog series, we outline differences between Fixed-Function OpenGL with Modern OpenGL and show effective solutions for common issues encountered when porting your code to Modern OpenGL. I was once faced with the task of “modernizing” a large fixed-function rendering engine.  At the time, I was very well versed in the fixed-function programming model but only had vague knowledge of the “new” shader-based OpenGL.  With the release of OpenGL 3.3, all of the fixed-function...
October 28, 2015  •  By Jeff Tranter  •  Qt, QML, Best Practice, OpenGL, Embedded
Inspired by Halloween, I'd like to present a list of ten "scary" mistakes using Qt. Based on the wide experience of ICS with Qt consulting projects, I have provided a list of errors that can doom any project. 1. Waiting too long to test on hardware One of Qt's strengths is its cross-platform support and often when developing for embedded platforms it means that you can start development on a desktop system and not need to wait until your embedded hardware is ready. However, it is important to test your code as soon as possible on the embedded hardware, either...
September 23, 2015  •  By Jeff Tranter  •  Qt, QML, Qt3D, OpenGL, 3D
In this blog post, we'll take a brief look at one of the newest Qt modules, Qt3D, which was introduced in Qt 5.5.0. What is Qt3D? Qt3D is a new Qt module that provides support for 2D and 3D rendering. It also provides a generic framework for supporting simulations that go beyond just rendering, and can include features like physics, audio, collision detection, artificial intelligence and path finding. It has APIs for both C++ and Qt Quick (QML) and uses OpenGL as the underlying technology. Current Status Qt3D has been in development for some time, and its scope has expanded, in...
August 5, 2015  •  By Eric Stone  •  Qt, QML, OpenGL, scene graph
This blog post presents a short example program that illustrates how to use OpenGL and Qt in a scene graph. The two main goals are to show how the scene graph can be used, and more importantly, how to incorporate your own OpenGL code as part of the scene graph (as opposed to overlaying them). The code is relatively short and commented so rather than describe it here in detail, I suggest you build and run it, and then study the code, possibly making some changes of your own. The complete source code can be downloaded from here. The example will build with recent versions of Qt 5 on...
December 31, 2014  •  By Jeff Tranter  •  Qt, Embedded, 2014, IVI, Raspberry Pi, OpenGL
As the year draws to a close, I thought it would be good to take a look back at some of the major events of the Qt world in 2014. Qt is now on a regular schedule of two major releases per year. We saw Qt 5.3.0 (1) come out in May and Qt 5.4.0 (2) in December. More minor releases occur, as needed, between the major releases. Qt 4 continues to see maintenance releases with a Qt 4.8.6 (3) coming out this year, and a 4.8.7 release planned in the first quarter of 2015. As announced at Qt Developer Days, Qt 4 will be officially supported for one more year. If the experience of Qt 3 is any...
May 21, 2014  •  By Eric Stone  •  OpenGL, Assimp, Qt, 3D
This blog post is the first in a series that will cover using OpenGL with Qt. In this installment, we will look at how to use Open Asset Import Library (Assimp) (1) to load 3D models from some common 3D model formats. The example code requires Assimp version 3.0. The code also uses Qt for several convenience classes (QString, QVector, QSharedPointer, etc...). Read Part 2 Qt and OpenGL: Loading a 3D Model with Open Asset Import Library (ASSIMP) Introduction First, we will create some simpl e classes for holding the data for the model. The structure MaterialInfo will contain...
June 26, 2013  •  By Jeff Tranter  •  Qt, OpenGL, QML
Introduction This blog posting gives an introduction to the Qt Graphical Effects module which is available in Qt 5. As of Qt 5.1 the module offers 25 QML components which support effects in these categories: blend, color, gradient, distortion, drop shadow, blur, motion blur, glow and mask. List of Effects Here is the list of effects provided as of Qt 5.1: Effect Description Blend Merges two source items by using a blend mode. BrightnessContrast Adjusts brightness and contrast. ColorOverlay Alters the colors of the...