harder cases of triangle projection

Started by
10 comments, last by JohnnyCode 9 years, 10 months ago

The way Im talking is reverse order full 3d clipping then projection - so maybe this way is a harder one but i do not see still the reason why it may be strictly incorrect (as I said it do not makes cuts of the figures in visible space that may occur in the first way (though anyway im not sure if this cutting effect my be masked so player will never see this or this makes visible artifacts though)


It's incorrect because you can end up with a triangle that contains a vertex at the tip of the pyramid, which is a degenerate point. The tip of the pyramid is technically on the projection line of every single point in space. The reason for a near plane is to avoid that problem.

this is not any problem though - if so you just can treat that whole screen is in the color of this point of the triangle

Advertisement

the near plane clipping is a technical limitation of float range, that can be overcome only by near-far on air tweeks.

The rasterized depth tested pixel is (x/w,y/w,z/w.w), where w component is 3rd component of pixel before projection transformation (the view space z).

If w becomes very small, limiting to zero, you end up with too large numbers to sanely represent even in double floating numbers. That is why you clip those pixels before you devide them with their w component and rasterize them.

One other need of near plane and far plane is explaining the distribution of depth buffer as well. If the (far plane)/(near plane) value overcomes the 24 or 32 or 16 bit unsigned integer 0-1 clamp, you have screwed up depth buffer pricision. That is why no one sets near plane to 0.0001 and far plane to 100 000.0.

Even if you set the far plane to 0.01f, you will not be able to set near plane to pure exact zero, and you will need near >0 clipping plane even if you will observe atomic portions of world.

This topic is closed to new replies.

Advertisement