opengl - Interpolation of varying variable in fragment shaders under the hood -


i have triangle 3 vertrices v1, v2, v3 ℝ3 , texture coordinates t1, t2, t3. linear surface boundaries.

the interpolation see: define mapping "m" surface subset of ℝ3 (0,1)**2 1 constraint m(v1)=t1; m(v2)=t2; m(v3)=t2;

is exist more constraints function "m"?

the final aim "rasterize" triangle in 2d "window space".

how know texture coordinate concrete rasterzied point of triangle? heard couple methods how it. is exist others?

  1. perform linear interpolation along edges, , make intepolation in scan line

  2. use barycentric coordinates of each point in ℝ3 before "rasterized" ℝ2. make affine combination of "varying" variables t1,t2,t3

which schema used in rasterization stage in modern hardware?

opengl uses barycentric coordinates interpolating varying variables. checked far opengl 2.1 spec, , described way in section titled "basic polygon rasterization" (section 3.5.1, page 109), , looks unchanged in latest 4.5 spec (section 14.6.1, page 451).

you can find referenced spec documents in opengl registry.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -