
John Carmack on shadow volumes (2000) - p7g5
http://fabiensanglard.net/doom3_documentation/CarmackOnShadowVolumes.txt
======
IvyMike
John Carmack has an ability to iterate and do throwaway experiments on complex
code like almost no one else I can think of. I write complex code sometimes,
but when I do I rarely want to just start over with a new approach again and
again like he does.

It's awesome that when he lets us peek behind the curtain to see his process.

~~~
corysama
"Focused, hard work is the real key to success. Keep your eyes on the goal,
and just keep taking the next step towards completing it. If you aren't sure
which way to do something, do it both ways and see which works better."
\--John Carmack

~~~
bachback
"Putting creativity on a pedestal can also be an excuse for laziness. There is
a lot of cultural belief that creativity comes from inspiration, and can't be
rushed. Not true. Inspiration is just your subconscious putting things
together, and that can be made into an active process with a little
introspection. Focused, hard work is the real key to success. Keep your eyes
on the goal, and just keep taking the next step towards completing it. If you
aren't sure which way to do something, do it both ways and see which works
better." \- John Carmack

~~~
BuckRogers
JC is technically brilliant but in other aspects of intelligence has been
questionable. This interesting quote is a classic example of a Yogi Berraism.
Claiming you can rush creativity, you just need to have the time to rewrite
your complex code 2 or 3 times.

~~~
corysama
His claim is that doing a ton of really hard work repeatedly is still a lot
faster and more reliable than waiting under the apple tree for a flash of
inspiration.

The flash-of-inspiration mode of creativity has been dramatized so much that
most of the population assumes that's just how it's done. It also seems way
easier than hard work, so people want it to be true when they try to be
creative. Simultaneously, it seems way less attainable than plain old hard
work (the requirements seem to be mostly circumstance), so people also want it
to be true when they are not trying to be creative ("My great idea just hasn't
come to me yet!").

JC is reminding us of the hard truth: the reality behind the stories is that
creativity is the prize of determination, not serendipity.

~~~
BuckRogers
I would contend being under the apple tree is how it's done. Even for JC. Easy
for him to say the contrary, when his business was always largely handled by
others as a byproduct of him also being at the right-place at the right-time.
This is why he's known to shut the door and hide. He didn't have to be a busy-
body handling the day to day operations of id Software. It's the reason he was
able to sit thinking about 2-3 shadow volume techniques, _and_ the time to
implement and test them all.

If that's not the 'apple tree' of software development, I don't know what is.

I'd bet my life that if you have no time to sit and think, just a busy-body
answering phone calls, emails, you're not coming up ideas. At one point JC did
sit and think, hard. Then he implemented hard.

Through the whole process he had isolation, so he really was _' under the
apple tree'._ Irregardless if his process involved building prototypes of his
various ideas.

~~~
corysama
I'm pretty sure that you and JC actually agree completely. You are just going
into more detail about my vague apple tree analogy than I did.

~~~
BuckRogers
Maybe on details, but we disagree that you can rush creativity or genius. His
trial-and-error method got him shadow volume years after a separate pair of
engineers discovered it. This is why most great discoveries are done in
research environments with teams.

He in my view, failed to see that he just filled his 'apple tree' time with
tinkering. Some people plant a garden while thinking about code, or focus
intently. I'm not sure there's much difference between methods, it depends on
the field and person.

The most complex fields, involving what I'd consider true genius cannot be
tested. It's just too general of a statement, and only relevant to him or a
portion of the population.

But this is Carmack as I've always seen him. Technically brilliant, missing
the big picture (his games were in some cases restricted simply to show off a
technical feature eg. the Doom 3 flashlight), and fairly narrow minded.

------
doomlaser
This is called "Carmack's Reverse", and was used for the realtime stencil
buffer shadows in Doom 3:
[http://en.wikipedia.org/wiki/Shadow_volume](http://en.wikipedia.org/wiki/Shadow_volume)

Stencil buffer shadows were very popular in the mid 2000s because of their
performance and relative simplicity in implementation. Their main drawback is
that there is no easy way to get a soft penumbra around shadow edges. You can
spot them in many games from the last generation because of their universal
hard edges -- an area is either in shadow or not. See: Mario Galaxy, etc.

~~~
phoboslab
Without having played Mario Galaxy myself, judging from screenshots it seems
the game is using shadow maps[1] or just static geometry for fake shadows[2].

[1]
[http://screens.latestscreens.com/wii/screenshots/supermariog...](http://screens.latestscreens.com/wii/screenshots/supermariogalaxy/screenshot_super_mario_galaxy_3.jpg)

[2] [http://images9.gry-
online.pl/galeria/galeria_duze3/169624250...](http://images9.gry-
online.pl/galeria/galeria_duze3/169624250.jpg)

~~~
kazinator
It looks quite fake. Most objects in the scene are not participating in
casting shadows, and the shadows cast by the characters don't seem to be
forged from their true silhouette.

------
codezero
This is pretty interesting to read, but does anyone have any good links that
describe what shadow volumes are and why this solution was clever at the time?
Is it still clever, or has some new method taken its place?

~~~
ginko
Shadow mapping[1] has pretty much taken over at this point. This is mainly
because of the high overdraw when rendering shadow volumes. You can also
filter shadow maps to get soft shadows. This is not really possible with
shadow volumes.

Raytraced shadows are starting to become feasible.

[1][http://en.wikipedia.org/wiki/Shadow_mapping](http://en.wikipedia.org/wiki/Shadow_mapping)

~~~
kleiba
Let's not forget that he was not the first to come up with this technique.
From wikipedia [1]:

 _William Bilodeau and Michael Songy discovered this technique in October
1998, and presented the technique at Creativity, a Creative Labs developer 's
conference, in 1999.[2] Sim Dietrich presented this technique at both GDC in
March 1999, and at Creativity in late 1999.[3][4] A few months later, William
Bilodeau and Michael Songy filed a US patent application for the technique the
same year, US 6384822 , entitled "Method for rendering shadows using a shadow
volume and a stencil buffer" issued in 2002. John Carmack of id Software
independently discovered the algorithm in 2000 during the development of Doom
3.[5] Since he advertised the technique to the larger public, it is often
referred to as Carmack's Reverse._

[1]
[http://en.wikipedia.org/wiki/Shadow_volume](http://en.wikipedia.org/wiki/Shadow_volume)

~~~
renox
<Sigh>, so many things are independently discovered.. Why do we still have
patents??

~~~
digi_owl
Patents were originally on the specific mechanical system (like the Colt
revolver) or chemical composition.

Math was excluded, as was computer code as a specific usage of mathematical
logic.

But slowly patents on computer code made its way into patents, initially as
code controlling mechanical or chemical processes.

------
lifeisstillgood
And this follows on insightfully from the discussion on "slow" programmers. In
most cases in the "business" world someone like Carmack would have been reamed
for re-implementing code that already worked, or for taking valuable time away
from the next project.

Crazy. Slow is smooth, smooth is fast.

~~~
CyberDildonics
That would only happen if someone was like him and was being micro-managed by
a manager who wasn't familiar with him yet. John Carmack is crazy productive,
the vast majority of Quake (and predecessors) was written by him. Anyone with
a head on his shoulders watching over him for very long would see him
outperforming possibly the entire team and trust his judgement.

