PDA

View Full Version : Interpolation of colors after clipping



Jyk1234
10-11-2013, 09:45 AM
Hello All,

I have a small question regarding interpolation of colors after the clipping stage.

Scenario:
Say i have a quad, that gets intersected by the view frustum in such a way that
after clipping, i get two points newly generated. So, the frustum clips the quad in half
thus generating two new vertices.

Now, i would have given per vertex colors at the initial 4 vertices. What would be the colors
given to these newly generated vertices after clipping?

I understand the per fragment interpolation. But since that is at a later stage in the pipeline, i was wondering what color
is provided to the new vertices.

Can anyone please explain this?
Thanks!

arekkusu
10-11-2013, 10:28 AM
Put simply: attributes (like colors) are linearly interpolated when clipped.

You can read section 13.5.1 "Clipping Shader Outputs" in the spec for all the details (like flat shading).

Jyk1234
10-12-2013, 08:34 PM
Thanks for the reply a arekkusu!