Suppose my skybox is a sphere. I have learned that when draw a skybox, we can make the sphere's z value equal to its w value in the vertex shader, like this:

VertexOut VS(VertexIn vin) { VertexOut vout; //PosH stand for position in Homogeneous coordinate vout.PosH = mul(float4(vin.PosL, 1.0f), gWorldViewProj).xyww; //PosL stan for position in local coordinate,used as a lookup vector in cubemap vout.PosL = vin.PosL; return vout; }

I can't totally undestand why we can do like that. If we do so, after perspective divide, wouldn't there be two part of the sphere becomes in the view frustum's far plane, one behind the camera originally and the other in front of the camera originally? If they already in the view frustum, then, how can the pipeline clip out the one which behind the camera originally? Hope someone help me figure it out！