xantrus
xantrus

Reputation: 1985

Why are all of the four fragments of a quad fragment going to be shaded, even if a polygon covers only one of them?

Why are all of the four fragments of a quad fragment going to be shaded (calculating their color), if a triangle (polygon) for example, covers only one of them?

Upvotes: 0

Views: 527

Answers (2)

Bahbar
Bahbar

Reputation: 18015

Texturing requires derivatives of the texture coordinates passed in. This is because which mip-map to use depends on the variation of the texture coordinates in screen space. if the coordinates vary fast, then it means you're in fact using a large part of the texture on that one fragment (so the mipmap that will get picked is closer to the 1x1 level)

"Derivatives" here is the variation of the input coordinates per fragment. The typical way graphics cards implement this is to compute the coordinates on a 2x2 grid, and compute the difference between the different elements to get an approximation of the derivative.

Upvotes: 6

Ben Voigt
Ben Voigt

Reputation: 283634

The average color of the fragment still depends on those other vertices.

Upvotes: 3

Related Questions