Ways to disable camera far z clipping

shuipi

Newcomer
Is there any other way to disable camera far z clipping than changing the projection matrix? Because I only want to disable it for certain objects, so changing the projection matrix will make these objects' depth buffer values inconsistent with the rest of the scene, which causes all sorts of problems.

If I could disable it through a d3d api call it would be nice, but I didn't find any.
 
Shuipi,
FWIW, far Z clipping is, in all bar some odd use cases, rather pointless. In terms of Z accuracy it gains you very little (almost all of the Z accuracy is governed by the the near clip plane) and clipped geometry simply results in more triangles.

You are probably better off just doing culling of objects that are past a certain depth and use a plane positioned at the "clip" Z distance to hide sections of distant objects.
 
clipping is done prior to fragment generation, now there is a difference in terminology...

in the d3d pipeline what they call the rasterizer stage does indeed handle clipping but in the overall graphical pipeline: the rasterizer stage includes: primitive construction, fragment generation, pixel shaders, depth testing and blending.

Clipping is actually part of the geometry pipeline. The D3D pipeline is an implementation of the theoretical pipeline but their terminology differs slightly. They refer to the stage responsible for converting primitives to fragments as the rasterizer stage which is technically correct.
 
In DX10 you could set DepthClipEnable to false in your rasterizer state to disable far clipping. It will also disable near clipping though.
 
No, but I can measure the impact of rendering a large number of triangles at the frustum borders.

The last cards that really did triangle splitting were ATIs R5xx series.
 
Last edited by a moderator:
No, but I can measure the impact of rendering a large number of triangles at the frustum borders.
Which borders specifically? Left/Right/Top/Bottom would usually be handled by guard bands and only extremely large objects would actually require clipping.

Near and far could use clipping but, in all honesty, the number of triangles that protrude through these planes is generally quite small.
The last cards that really did triangle splitting were ATIs R5xx series.
The world of 3D is not limited to PC cards.
 
Which borders specifically?
Doesn't matter.

guard bands and only extremely large objects would actually require clipping.
Most likely on modern GPUs there are "infinite guard bands".

Real polygon clipping would be just a waste of time. The transistor count for a rasterizer that figures out which fragments lie within the visible portions of the view frustum without prior clipping should be negligible today.

The world of 3D is not limited to PC cards.
The Xbox 360 GPU could still be based on the R5xx series, but I wouldn't call that a "modern GPU". Also RSX is just a GeForce 7 with some external modifications.
 
Last edited by a moderator:
Most likely on modern GPUs there are "infinite guard bands".
Although, say, Dreamcast had "infinite" guard bands (i.e. the triangle set up took floating point values), this was far from ideal. AFAICS, you cannot reliably compute certain portions of the set up maths with unconstrained XY coordinates, unless you are also willing to implement arbitrary precision (rational) numbers, such as in GMP. That is not going to happen in hardware.
Real polygon clipping would be just a waste of time. The transistor count for a rasterizer that figures out which fragments lie within the visible portions of the view frustum without prior clipping should be negligible today.
Given that very few triangles are clipped, why is it a waste of time? Why waste effort in the rasterisation process on, IIRC, per-pixel calculations that are generally going to achieve nothing?
The Xbox 360 GPU could still be based on the R5xx series, but I wouldn't call that a "modern GPU". Also RSX is just a GeForce 7 with some external modifications.
I was talking about other GPUs which, I believe, are more numerous.
 
Back
Top