OpenGL Tutorial 4 (QS) – Animating & Warping Images – Loading Textures

preview_player
Показать описание
Images don’t need to just sit still when applied to mesh faces… indeed they can be animated, rotated, stretched and distorted in all sorts of ways, all without applying any transformations to the vertex positions of the model being rendered.

The fragment shader allows us to easily intercept how an object’s image texture corresponds to its mesh faces. By manipulating/changing the texture coordinates – although a different part of the image then applies, it still applies to the same part of the mesh face.

Simply by passing only 1 or 2 values (as uniform variables that are updated during every main-loop cycle on the CPU side) to the fragment shader, we can then produce all sorts of graphics special effects, albeit they’re limited to being displayed on a 2D plane.

00:00 - Introduction
00:20 - Demo 1: Various animations
01:09 - Downloading STB image loader
01:41 - Image folder & set up texture units
02:31 - Loading an image & setting parameters
03:49 - Demo 2: Cool effects (warping images)
04:30 - Demo 3: Mipmaps Min and Mag filters
06:40 - Special effects code analysis
Рекомендации по теме