programmable clipping

Is HW programmable clipping technically possible as a replacement for depth buffer units?

By HW programmable clipping, I meant having a HW unit (or HW units) that would allow for unlimited distance any of the 4 ways (up, down, ahead, behind) and precision would be the same for the entire frame buffer.

I've just always disliked the limitations of depth buffers, so I was wondering if a hardware replacement like I described was technically possible.
 
Depends on what you mean with "programmable clipping". If the hardware had a read-write buffer the shader could implement any culling mechanism it desired. At a huge cost in performance of course.

With DX10 I quite frankly don't see what limitations there are left to complain about. 32bit floats "ought to be enough for everyone". ;) And since you can disable the near clipping plane you can also realistically push the near plane forward a bit without getting artifacts an thus gain even more precision. Besides, any modern engine will need the depth buffer anyway. The depth is just a very useful property to have around.
 
I think hardware programmable clipping would be a good replacement for the z-buffer, b/c getting rid of the depth buffer would free us from a lot of limitations the z-buffer gives.

It would also be a near, if not exact balance between the w-buffer and the z-buffer. I know the w-buffer is dead, but I haven't seen any other game that has anything quite like rayman 3's bonus stages. It would be hard to do those without HW programmable clipping, since the w-buffer is dead.

I believe the ps2 used programmable clipping.
 
I don't understand what z buffer related limitations you're concerned about, but in addition to what Humus proposes aren't there user clip planes and the GS to allow some level of user clipping?
 
I don't understand what z buffer related limitations you're concerned about, but in addition to what Humus proposes aren't there user clip planes and the GS to allow some level of user clipping?
Draw distances aren't long enough for me, too much distance fog (sometimes used to cover up lack of precision in the distance, even in dx10 games such as dmc4,) and there's simply too little precision in the distance with the z-buffer.

An example of something programming with the z-buffer doesn't allow is rayman 3's bonus stages. That's the best example I can think of.

Also, look at one shot of Battletryst at system16.com. It runs on an m2-based arcade board which used the w-buffer. It's under Konami, then the M2 architecture.

If they made effects fully programmable back with dx 8.0, then they should've made fully programmable hardware clip planes replace depth buffers a long time ago.
 
I'm not sure what you're referring to - DMC4 has very little distance fog. 32-bit depth buffers are usually more than enough. Besides, depth buffer precision isn't why distance fog is used - distance fog is used because it happens in real life and because it helps hide low draw distances. And, once again, low draw distances aren't because of depth buffer precision issues... the lower the draw distance is, the less the video card has to draw, the faster your game runs.
 
I'm not sure what you're referring to - DMC4 has very little distance fog. 32-bit depth buffers are usually more than enough. Besides, depth buffer precision isn't why distance fog is used - distance fog is used because it happens in real life and because it helps hide low draw distances. And, once again, low draw distances aren't because of depth buffer precision issues... the lower the draw distance is, the less the video card has to draw, the faster your game runs.
There's not much distance fog, but it's there in some of the areas with very long draw distances. I'd like the option to disable it, if it's for performance reasons, which it could very well be.
 
Is HW programmable clipping technically possible as a replacement for depth buffer units?
No, because they serve completely different purposes. A depth buffer is mainly used for hidden surface removal, something that clipping can't achieve in any sensible way.

By HW programmable clipping, I meant having a HW unit (or HW units) that would allow for unlimited distance any of the 4 ways (up, down, ahead, behind) and precision would be the same for the entire frame buffer.
4 ways? Unlimited distance would mean no clipping at all, so why programmable clipping?

You can have unlimited draw distance with a Z buffer. The reason games limit their draw distance is performance and memory requirements. Some games let you adjust the draw distance, others don't.
 
Draw distances aren't long enough for me, too much distance fog (sometimes used to cover up lack of precision in the distance, even in dx10 games such as dmc4,)

thats the game developers fault you can easily (well maybe not easily) have draw distances over 100km - is that big enough for you

ps: distance fog isnt used to cover up lack of presicion its used as a graphical effect or to reduce workload.
 
No, because they serve completely different purposes. A depth buffer is mainly used for hidden surface removal, something that clipping can't achieve in any sensible way.


4 ways? Unlimited distance would mean no clipping at all, so why programmable clipping?

You can have unlimited draw distance with a Z buffer. The reason games limit their draw distance is performance and memory requirements. Some games let you adjust the draw distance, others don't.

thats the game developers fault you can easily (well maybe not easily) have draw distances over 100km - is that big enough for you

ps: distance fog isnt used to cover up lack of presicion its used as a graphical effect or to reduce workload.
I believe you, but every game should allow you to turn it off, regardless of how much it helps performance. I mean, I guess turning it off could make certain games unplayable on a not-so-high-end system, but then crytek allowed users to play crysis @ 1920x1200 on a 3870 (or even less than a 3870) at highest settings, so why should they force fog on people?

I give 2 more examples with links, (shadowman and spider man the movie 3 for the ps2) since I guess no one here has played rayman 3, but that's ok.

Links will be a little later, i'm on a pos pc at my "university" now; fast connection, but doesn't matter b/c the pc sucks.

Look at mercenaries 2 though for the ps2, then the pc; they shots are at gamespot.

The ps2 has virtually no fog in nearly every shot, and much larger draw distances, while the pc version looks like crap, all fogged out, aliasing o'plenty, and much shorter draw distances with the little distance there is losing mad detail (not very) far away.

Also, one more question: why do ps2 games have insane draw distances with no fog and not lose precision further away like pc games do? What does the ps2 have in place of a z-buffer?
 
What makes you think they don't have a Z buffer? As Xmas pointed out: How are you going to do fast hidden surface removal?
Good question=]

I heard somewhere that the PS2 had issues with the Z-buffer, so they used some kind of work around. What that work-around was, I'd like to know.

Plus it's apparent that the PS2 was using something other than a z-buffer, because you don't see even DX10 games with draw distances and far precision as good as many PS2 games.

Also, the PS2 couldn't have had enough VRAM for a 32 bit RGBA frame buffer and a 32 bit z-buffer anyway. It only had 4 MB of VRAM, plus no compression techniques.

also here's the links:

Shadowman/Acclaim/Iguana U.K./1999 (uses w-buffer):

http://www.gamespot.com/pc/action/s...m_act=convert&om_clk=gsimage&tag=images;img;2

look at screenshot #2. there aren't many games as of late with any scenes of that magnitude.

spider man 3/PS2:

http://www.gamespot.com/ps2/action/...m_act=convert&om_clk=gsimage&tag=images;img;1

look at shots 2, 4, 12, and 15 specifically.


Also, look at screenshots of Mercenaries 2 for the PS2, then the PC shots also at gamespot.

Another question. Is fast hidden surface removal necessary to avoid artifacts? Or does it just speed things up? I know that's a dumb question, but I'm not a computer scientist lol.
 
screenshot number 2 doesnt have a large draw distance
heres a bigger one
http://uk.pc.ign.com/dor/objects/38...images/giants002.html;jsessionid=23pk2f3vrire

ps: do you have any pictures of these zbuffer artifacts
tnx...
I was asking:
Is fast hidden surface removal necessary to avoid artifacts? Or does it just speed things up?

and while that shot has a very long draw distance, the far away distance looks awful.

the screenshots i posted don't have any precision loss far away.

Thanks=]
 
I believe you, but every game should allow you to turn it off, regardless of how much it helps performance. I mean, I guess turning it off could make certain games unplayable on a not-so-high-end system, but then crytek allowed users to play crysis @ 1920x1200 on a 3870 (or even less than a 3870) at highest settings, so why should they force fog on people?
I'm not familiar with these games, but real life has distance fog. It might not fall off at the same rate, but it's there. So don't rule out artistic reasons for not allowing you to turn it off.
 
I heard somewhere that the PS2 had issues with the Z-buffer, so they used some kind of work around. What that work-around was, I'd like to know.
The only issue with z-buffers on the PS2 is that you get a performance penalty if the Z values of the vertices in a triangle are too far apart. The only workaround is to use z-buffers with less precision.

Plus it's apparent that the PS2 was using something other than a z-buffer, because you don't see even DX10 games with draw distances and far precision as good as many PS2 games.
No it doesn't, and yes you do http://maxygames.no.sapo.pt/Crysis.jpg

Also, the PS2 couldn't have had enough VRAM for a 32 bit RGBA frame buffer and a 32 bit z-buffer anyway. It only had 4 MB of VRAM, plus no compression techniques.
First of all, it does have more than enough ram for 32bit frame and z-buffers. A common setup is 512x448x32 back buffer + a 512x448x16 front buffer. Add a 32 bit zbuffer to that and you only need 2.2MB ram. Make the frontbuffer 32bit too and you end up with 2.6MB. Increase the resolution to 640x480 and you need 3.5MB. That doesn't leave much for textures, but since the textures are streamed into the GS on the fly as they are needed during every frame it's still more than enough.

And, as have already been pointed out to you in another thread; compression is only used to reduce bandwidth, not memory usage, it actually increases mem usage. Except for texture compression, but you can do that on PS2 too.

Another question. Is fast hidden surface removal necessary to avoid artifacts? Or does it just speed things up? I know that's a dumb question, but I'm not a computer scientist lol.
It's only to speed things up, only triangles that have no effect on the rendered output are removed.

and while that shot has a very long draw distance, the far away distance looks awful.

the screenshots i posted don't have any precision loss far away.
The far away only look "awful" because of aliasing, that has nothing to do with z precision. Anyway, the shots you provided didn't even have any far away parts, so it's hard to compare.



Oh, and one more thing: The ps2 is actually a bit slow when it comes to drawing triangles with fog, maybe that's why you see less of it in PS2 games :). The best way to do fog on the PS2 by turning the z-buffer into an alpha texture and doing a full screen blend with the desired fog color, after you've drawn all opaque geometry.
 
The only issue with z-buffers on the PS2 is that you get a performance penalty if the Z values of the vertices in a triangle are too far apart. The only workaround is to use z-buffers with less precision.

No it doesn't, and yes you do http://maxygames.no.sapo.pt/Crysis.jpg

First of all, it does have more than enough ram for 32bit frame and z-buffers. A common setup is 512x448x32 back buffer + a 512x448x16 front buffer. Add a 32 bit zbuffer to that and you only need 2.2MB ram. Make the frontbuffer 32bit too and you end up with 2.6MB. Increase the resolution to 640x480 and you need 3.5MB. That doesn't leave much for textures, but since the textures are streamed into the GS on the fly as they are needed during every frame it's still more than enough.

And, as have already been pointed out to you in another thread; compression is only used to reduce bandwidth, not memory usage, it actually increases mem usage. Except for texture compression, but you can do that on PS2 too.

It's only to speed things up, only triangles that have no effect on the rendered output are removed.

The far away only look "awful" because of aliasing, that has nothing to do with z precision. Anyway, the shots you provided didn't even have any far away parts, so it's hard to compare.



Oh, and one more thing: The ps2 is actually a bit slow when it comes to drawing triangles with fog, maybe that's why you see less of it in PS2 games :). The best way to do fog on the PS2 by turning the z-buffer into an alpha texture and doing a full screen blend with the desired fog color, after you've drawn all opaque geometry.
Thanks=]

You're a programming/hardware mastermind.
 
As Thowllly pointed out its aliasing thats making it look bad
and the distance is over 10times the distance in shadowman
the town below is 10,000 meters away
 
Last edited by a moderator:
I believe you, but every game should allow you to turn it off, regardless of how much it helps performance. I mean, I guess turning it off could make certain games unplayable on a not-so-high-end system, but then crytek allowed users to play crysis @ 1920x1200 on a 3870 (or even less than a 3870) at highest settings, so why should they force fog on people?

Distance fog is mostly an artistic decision. It's not directly related to draw distance, although as a bonus distance fog helps hide the fact that there's no infinite draw distance. Distance fog is something that happens in real life, which is evident from any random photo with a distant view (like for instance this one).

Large draw distance on the other hand is an engine limitation. Long draw distances comes with a whole range of interesting problems, like an awful lot of stuff in your view frustum to draw. Not that it's impossible though, I work at a company that does these kind of draw distances:
Just-Cause-Just-cause-main-character.jpg


Now of course that's because we've spent large engineering resources into making it happen. The draw distance tends to be tied to your game and engine design. You can't normally just enable larger draw distances at a performance hit. The artwork is generally made for a certain draw distance. The exception may be racing games which tend to have more adjustable draw distances.

As Thowllly pointed out its aliasing thats making it look bad
and the distance is over 10times the distance in shadowman
the town below is 10,000 meters away

Well, distance in meters is one thing. You can easily make a space game and get awfully impressive distances. What really matters is the distance ratio of your near and far objects as well as the field of view.
 
Back
Top