How it works...

Qt 5 makes loading textures a really easy job. All it takes is just a single line of code to load an image file, flip it, and convert it into an OpenGL-compatible texture. The texture coordinates are pieces information that let OpenGL know how to stick the texture onto the object's surface before displaying it on screen.

The min and max filters are filters that make the texture look better when it is applied on a surface that is bigger than what its resolution can cover. The default setting for this is GL_NEAREST, which stands for nearest neighbor filtering. This filter tends to make texture look pixelated when viewed close up. Another common setting is GL_LINEAR, which stands for bilinear filtering. This filter takes two neighboring fragments and interpolates them to create an approximated color, which looks a lot better than GL_NEAREST:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset