MISTAKE:
I made a small mistake in my description of the solution. You must divide the values by z before you interpolate between them to account for the perspective divide. Interpolated value = v1/z1*w1+...
In this video I describe exactly what we will implement in the video and the math behind it. I also cover some common pitfalls and solutions to those problems.
Barycentric coordinates:
https://www.scratchapixel.com/lessons...
Github: https://github.com/youngbrycecode/Ren...
Chapters:
0:00 Introduction
0:10 Pipeline
1:20 Barycentric Interpolation
2:11 Naive approach
3:00 Correct approach
Pipeline:
1. Get floats from vertex shader
2. Interpolate between them
3. Pass to fragment shader and render with result
Common pitfall:
Using affine space barycentric interpolation.
Corrected solution:
float inverseZ = 1/z1 * w1 + 1/z2 * w2 + 1/z3 * w3;
float interpolatedValue = value1 * w1 + value2 * w2 + value3 * w3;
float finalInterpolation = interpolatedValue / inverseZ;
//pass to fragment shader
In questa pagina del sito puoi guardare il video online NCurses 3D Render Engine Tutorial 12 (Precursor explanation) della durata di ore minuti seconda in buona qualità , che l'utente ha caricato KayOS Code 09 marzo 2021, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 267 volte e gli è piaciuto 3 spettatori. Buona visione!