<p>Don't know the game but hard shadows are usually shadow volumes, often implemented with help of a stencil buffer. You can find a short description of the algorithm on Wikipedia.</p>

CC BY-SA 3.0
2018-02-27T14:49:51.247Z
Yes this is the technique the person is looking for.  It is perfectly crisp because the shadows are actual rendered geometry.  It would be nice if you could provide a simple description of the technique!
Wikipedia has some decent info too: https://en.wikipedia.org/wiki/Shadow_volume
Alan Wolfe
CC BY-SA 3.0
2018-02-27T21:41:03.067Z
@AlanWolfe Shadow volumes would explain the crispness, however does not fit the OP's statement that the shadows extend above the character (closer to the light than the shadow caster). The classic shadow volume algorithm doesn't have that artifact.
Nathan Reed
CC BY-SA 3.0
2018-02-28T12:49:34.270Z
Exactly @NathanReed - Shadow volumes were one of my first research points but it just didn't seem right.
Steffan Donal
CC BY-SA 4.0
2024-10-27T10:33:46.997Z
It depends on how the volume is created, if it was just built as a vertical pillar for whatever reason in that particular game, it would always shade the full height of the wall. But who knows what they did exactly.
DanielB
CC BY-SA 3.0
2018-02-27T05:00:21.323Z
2018-02-27T05:00:21.323Z
George
<p>Having not worked on these games, I can only speculate... but from your description, it sounds like a crude shadow map with orthogonal projection and no depth information. It probably has (or had) a specific name but the way I suspect they did it is:</p>

<ul>
<li>Render the character from above to a binary texture (eg. white there there's nothing, black where the character is), using an orthographic camera.</li>
<li>When rendering the scene, perform a lookup in that texture and multiply by that color. You would of course exclude your characters from that.</li>
</ul>

<p>The calculations involved for the texture lookup would be trivial as everything is 2D, in a plane of the world coordinates. It also does not need programmable shaders which IIRC were not around yet at that time. What you would need as texture coordinates is simply the (x,z) location of the vertex (assuming y is toward the sky here), along with an offset equal to the (x,z) location of your character. In OpenGL, I believe that could be achieved by <code>glTexGen</code> along with a texture transformation matrix.</p>

<p>The reason for the artifacts is that this really does make a "character-silhouette shaped tube", as you put it. Looking from above, the shadow is painted on every surface regardless of it being in front of or behind the character (above or below, from the camera's view). It's like you're dropping black ink from the sky inside the outline of the character and it goes through everything.</p>

CC BY-SA 3.0
2018-02-23T11:02:52.883Z
I feel like this is pretty close, but I'd love a slightly more in-depth answer - specifically how this texture lookup works and *why* specifically this method results in artifacts of the shadow on walls and ceilings.
Steffan Donal
CC BY-SA 3.0
2018-02-23T14:19:02.863Z
@SteffanDonal fair point. I will add some details of what I had in mind.
Olivier
CC BY-SA 3.0
2018-02-22T20:28:11.593Z
2018-02-23T14:47:18.880Z
2018-02-23T14:47:18.880Z
Olivier
<p>I've been hunting around the internet for a while now, and I can't find anything about the specific shadow technique that I'm looking for.</p>

<p>I can only recall one game in particular that used it, and I know that it happens on the PC port of the game too. The game in question is "Sonic Adventure 2: Battle" for GameCube. I remember it happening on "Super Mario Sunshine", but I could be mistaken.</p>

<ul>
<li>The shadows are only cast from the main player character.</li>
<li>It is 100% sharp, no matter the resolution the game is rendered at.</li>
<li>They are cast perfectly parallel down onto the surface the player stands on.</li>
<li>Interestingly, if the shadow intersects with a vertical wall, the shadow is drawn all the way up the wall, even higher than the original intersection.</li>
<li>You can also see the shadow on ceilings directly above the player character, and even on floors above ceilings. It's as if there's a big character-silhouette shaped tube being cast onto surfaces.</li>
</ul>

<p><strong>How does this technique work, and how can I learn more about it?</strong></p>

<p>I'm going to hunt for a picture of this particular technique, but I don't have one right now.</p>

CC BY-SA 3.0
2018-02-22T09:01:18.807Z
*" in early 3d (2000 - 2004)"*  Hah! You youngsters.
Simon F
CC BY-SA 3.0
2018-02-27T11:00:16.990Z
There were more earlier games from 90's :) Those were incredible in their times.
Abdullah Ilgaz
CC BY-SA 3.0
2018-02-27T14:50:03.383Z
https://en.wikipedia.org/wiki/Shadow_volume <-- that
Alan Wolfe
<rendering><3d><gpu><shadow>
How did the hard, accurate shadows, work in early 3d (2000 - 2004) games?
Steffan Donal
# How did the hard, accurate shadows, work in early 3d (2000 - 2004) games?

(Asked by: username_0 on 2018-02-22)

I've been hunting around the internet for a while now, and I can't find anything about the specific shadow technique that I'm looking for.

I can only recall one game in particular that used it, and I know that it happens on the PC port of the game too. The game in question is "Sonic Adventure 2: Battle" for GameCube. I remember it happening on "Super Mario Sunshine", but I could be mistaken.

* The shadows are only cast from the main player character.
* It is 100% sharp, no matter the resolution the game is rendered at.
* They are cast perfectly parallel down onto the surface the player stands on.
* Interestingly, if the shadow intersects with a vertical wall, the shadow is drawn all the way up the wall, even higher than the original intersection.
* You can also see the shadow on ceilings directly above the player character, and even on floors above ceilings. It's as if there's a big character-silhouette shaped tube being cast onto surfaces.

**How does this technique work, and how can I learn more about it?**

I'm going to hunt for a picture of this particular technique, but I don't have one right now.

**Tags:** rendering, 3d, gpu, shadow

> **Comments:**
> **username_1**: *" in early 3d (2000 - 2004)"*  Hah! You youngsters.  
> **username_2**: There were more earlier games from 90's :) Those were incredible in their times.  
> **username_3**: https://en.wikipedia.org/wiki/Shadow_volume <-- that  

---

## 2 answers

### Answer by username_7 on 2018-02-22. Score: 5 | Accepted answer

Having not worked on these games, I can only speculate... but from your description, it sounds like a crude shadow map with orthogonal projection and no depth information. It probably has (or had) a specific name but the way I suspect they did it is:

* Render the character from above to a binary texture (eg. white there there's nothing, black where the character is), using an orthographic camera.
* When rendering the scene, perform a lookup in that texture and multiply by that color. You would of course exclude your characters from that.

The calculations involved for the texture lookup would be trivial as everything is 2D, in a plane of the world coordinates. It also does not need programmable shaders which IIRC were not around yet at that time. What you would need as texture coordinates is simply the (x,z) location of the vertex (assuming y is toward the sky here), along with an offset equal to the (x,z) location of your character. In OpenGL, I believe that could be achieved by `glTexGen` along with a texture transformation matrix.

The reason for the artifacts is that this really does make a "character-silhouette shaped tube", as you put it. Looking from above, the shadow is painted on every surface regardless of it being in front of or behind the character (above or below, from the camera's view). It's like you're dropping black ink from the sky inside the outline of the character and it goes through everything.

> **Comments:**
> **username_0**: I feel like this is pretty close, but I'd love a slightly more in-depth answer - specifically how this texture lookup works and *why* specifically this method results in artifacts of the shadow on walls and ceilings.  
> **username_7**: @username_0 fair point. I will add some details of what I had in mind.  

---

### Answer by username_4 on 2018-02-27. Score: 2

Don't know the game but hard shadows are usually shadow volumes, often implemented with help of a stencil buffer. You can find a short description of the algorithm on Wikipedia.

> **Comments:**
> **username_3**: Yes this is the technique the person is looking for.  It is perfectly crisp because the shadows are actual rendered geometry.  It would be nice if you could provide a simple description of the technique! Wikipedia has some decent info too: https://en.wikipedia.org/wiki/Shadow_volume  
> **username_5**: @username_3 Shadow volumes would explain the crispness, however does not fit the OP's statement that the shadows extend above the character (closer to the light than the shadow caster). The classic shadow volume algorithm doesn't have that artifact.  
> **username_0**: Exactly @username_5 - Shadow volumes were one of my first research points but it just didn't seem right.  
> **username_6**: It depends on how the volume is created, if it was just built as a vertical pillar for whatever reason in that particular game, it would always shade the full height of the wall. But who knows what they did exactly.  

---

