carmack's reverse

Started by
5 comments, last by picklejuice 20 years, 1 month ago
I''ve googled this subject many times, even read through the article on gamedev, but I''m still kind of in the dark here; could somebody explain carmack''s reverse to me?
Advertisement
When determining whether or not a pixel is in shadow, you can compare the number of shadow volume front and back faces that are in front of the pixel ("zpass"), or you can compare the number of shadow volume front and back faces that are not in front of it ("zfail"). The results are the same.

There are serious complications. The zpass result will be wrong if the near-plane clips a shadow volume. The zfail result will be wrong if the far-plane clips a shadow volume. The errors are especially difficult to correct using the zpass technique.

The advantage of zfail is that it is much easier to overcome the far-plane clipping problem than the near-plane clipping problem.

The zfail technique is also called "Carmack's Reverse" because of a widely circulated email by John Carmack where he explains how he realized an advantage of zfail -- the far-plane clipping problem can be overcome by capping the shadow volumes. Though capping the shadow volumes is not perfect and not trivial to implement, it is much easier and more effective than any solution for overcoming the near-plane clipping problem of zpass.

In 2002, Everitt and Kilgard demonstrated how moving the far plane to infinity also elminates the far-plane clipping problem and removes the need to cap the shadow volumes.

[edited by - JohnBolton on February 29, 2004 3:28:00 PM]
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
Just a side note, Carmak is a genious, dont get me wrong, but ive heard taht many equasions and such that have been attributed to him, really arent his
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out his new home he rounded a corner and saw someone in Marine Dress Blues. He ran back to St. Peter and yelled "You lied to me! There are Marines in heaven!" St. Peter said "Who him? That's just God. He wishes he were a Marine."
@Ademan555:
that is true, in a "slightly different way":
no one of all those "great developer", who you do know nowadays, are such geniouses - because they are only applying techniques, which would rotten on university server''s and research laboratories, if they won''t use it in computer games - nearly 90% of all those "cutting edge features", as you will call them, have been available since a long time on the internet - you only need to know, how to search...
(e.g. Blinn''s bumpmapping, around ~1975; but it was not used before 2 years)


DJSnow
---
this post is manually created and therefore legally valid without a signature
DJSnow---this post is manually created and therefore legally valid without a signature
quote:Original post by JohnBolton
When determining whether or not a pixel is in shadow, you can compare the number of shadow volume front and back faces that are in front of the pixel ("zpass"), or you can compare the number of shadow volume front and back faces that are not in front of it ("zfail"). The results are the same.

There are serious complications. The zpass result will be wrong if the near-plane clips a shadow volume. The zfail result will be wrong if the far-plane clips a shadow volume. The errors are especially difficult to correct using the zpass technique.

The advantage of zfail is that it is much easier to overcome the far-plane clipping problem than the near-plane clipping problem.

The zfail technique is also called "Carmack's Reverse" because of a widely circulated email by John Carmack where he explains how he realized an advantage of zfail -- the far-plane clipping problem can be overcome by capping the shadow volumes. Though capping the shadow volumes is not perfect and not trivial to implement, it is much easier and more effective than any solution for overcoming the near-plane clipping problem of zpass.

In 2002, Everitt and Kilgard demonstrated how moving the far plane to infinity also elminates the far-plane clipping problem and removes the need to cap the shadow volumes.


this post was rather hard for me to understand so I had to use the gamedev dictionary, however, some things are not listed so I'll try to explain what I don't understand here;
what I do think to understand is that the shadow calculation can easily be done when images are loaded nearby, by comparing to the existing shadow pixels (?? I don't really grasp this part though, how does that work?), but this can't be done when images are loaded far away, that can be solved by "capping" (which I don't understand either)


thanks for the info anyway, if you could explain the above things that would be a great help, thx!

edit: far is easy, close is hard, sorry

[edited by - picklejuice on February 29, 2004 10:38:50 AM]
Sorry. I assumed that because you asked specifically about "Carmack''s Reverse" that you knew what it applies to.

Here is the background:

There are several methods for rendering shadows. One category of methods is called "stenciled shadow volumes" (or just "shadow volumes"). "zpass" and "zfail" are two methods in that category. "Carmack''s Reverse" is another name for "zfail".
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
thanks! edit: anyone care to elaborate a little on the above 3 methods? I'd really appreciate it

[edited by - picklejuice on March 3, 2004 5:19:09 PM]

This topic is closed to new replies.

Advertisement