3D Fundamentals Tutorial 10
From Chilipedia
In this tutorial we get the butt wiggling texture to respect our authoritae! In other words, we upgrade our affine texture mapping to perspective-correct texture mapping, putting the kibosh on the fucked-up texture distortion.
Contents
[hide]Video
The tutorial video is on YouTube here.
You can see a video that really exaggerates what affine (warpy) textures look like here.
[Expand]
- The need for perspective correction: texture warping 0:47
- Explanation & visualization of the problem 1:57
- The math: the z divide makes mapping nonlinear 4:28
- Solution: interpolate between the z-divided texture coordinates 5:00
- Implementing this into code 8:40
- Solution used in hardware pipelines / GPUs 14:11
Downloads
The GitHub repository for the tutorial code is here.