d123

08-27-2003, 07:32 AM

How does opengl handle clipping exactly ?

I mean the DirectX standard is after applying the composite world - view - projection matrix

any vertexes that do not satisfy the following formulas are clipped:

-w < x < w | | -w < y < w | | 0 < z < w. Well a few days ago nvidia has released 2 examples of how you can have user clipping planes for free emulated with projection matrix. The ideea is that on matrix column/raw (depending if u got directx matrix style or opengl style) of the z you put a litle plane that force the z to be clipped where you want but the projection to screen space is still right because w is generated ok. Well the directx example makes exactly what I was expecting. No more ZNear clipping since the z are somewhere else (still is weird that no back projection appear) weird zbuffer (obvious because the z is the distance to a user plane that can have arbritrary orientation). The ZBffer can be solved with a w-buffer. BUT and there is a big BUT the opengl example does not do this. The z-problem is still there but no z turning when the plane normal is orientated to the view and the znear clipping is still working. If the opengl does the clipping as the directx how can this be happening ?

I mean the DirectX standard is after applying the composite world - view - projection matrix

any vertexes that do not satisfy the following formulas are clipped:

-w < x < w | | -w < y < w | | 0 < z < w. Well a few days ago nvidia has released 2 examples of how you can have user clipping planes for free emulated with projection matrix. The ideea is that on matrix column/raw (depending if u got directx matrix style or opengl style) of the z you put a litle plane that force the z to be clipped where you want but the projection to screen space is still right because w is generated ok. Well the directx example makes exactly what I was expecting. No more ZNear clipping since the z are somewhere else (still is weird that no back projection appear) weird zbuffer (obvious because the z is the distance to a user plane that can have arbritrary orientation). The ZBffer can be solved with a w-buffer. BUT and there is a big BUT the opengl example does not do this. The z-problem is still there but no z turning when the plane normal is orientated to the view and the znear clipping is still working. If the opengl does the clipping as the directx how can this be happening ?