Mastering GLSL in TouchDesigner, Lesson 2: Texture Sampling and Per-Texel Calculations
In this lesson of Mastering GLSL in TouchDesigner, we dive into texture sampling and per-texel calculations, exploring how shaders process images at the pixel level. You’ll learn about gl_FragCoord, UV coordinates, and the difference between texture() and texelFetch(). We’ll also cover practical applications like creating gradients, flipping textures, and manipulating image data in real-time. By the end, you’ll have a strong foundation for working with textures in GLSL shaders inside TouchDesigner, and know what weird terms like ‘swizzling’ mean!
Find me online:
Project Files/Patreon: https://www.patreon.com/water__shed
Portfolio: https://www.lakeheckaman.com
IG: https://instagram.com/lake_heckaman
00:00 – Intro
01:33 – Swizzling
03:55 – Sampling a texture or image in GLSL TOPs
06:42 – Debugging GLSL in TouchDesigner
08:17 – Example: Sample Texture
12:07 – Sampling from several texture inputs
16:12 – Simple Gradient and Swizzling
22:52 – Exercises!! (and the mix function)