PDA

View Full Version : Regarding clipping



myk45
03-03-2013, 11:56 PM
Hello All,

I have a small question regarding clipping. Now i know that the clipping happens in the clip space. So, we can throw away points if outside the view frustum, else retain it.
Now, suppose we have a line wherein one point is outside and another is inside. So, we need to clip this exactly till the point where the line intersects the view frustum.
Is this computation also done in the clip space?

So, we need to generate a new vertex in the above example(the intersection point). Is this also done in the clip space?

Thanks!

Dark Photon
03-04-2013, 05:13 AM
So, we need to clip this exactly till the point where the line intersects the view frustum.
Is this computation also done in the clip space?
Yes. Once you're coding in shaders, you'll see that that CLIP-SPACE may be the only space in which the GPU receives your vertex positions.

myk45
03-04-2013, 09:35 PM
> Once you're coding in shaders, you'll see that that CLIP-SPACE may be the only space in which the GPU receives your vertex positions.

Thanks for the reply Dark Photon. I'm a little confused. Clip space is the space in which the GPU receives vertex positions? Doesn't the vertex shader typically output vertices in clip space? after the projection?

menzel
03-04-2013, 11:44 PM
I guess what Dark Photon meant was the GPU receives the vertices from your vertex shader in clip space.

myk45
03-07-2013, 02:47 AM
Yeah, i suppose. Thanks!