Interpolation of colors after clipping

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!

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).

Thanks for the reply a arekkusu!