
Wind Waker Graphics Analysis - ingve
https://medium.com/@gordonnl/wind-waker-graphics-analysis-a0b575a31127
======
Jasper_
( Copying my comment from an earlier post:
[https://news.ycombinator.com/item?id=12921949](https://news.ycombinator.com/item?id=12921949)
)

One tiny thing that might help in your analysis: Nintendo accidentally
included all the symbol names and locations on the Wind Waker disc in a file
called "framework.map".

Doing some basic demangling on the CodeWarriors names gives you C++ classes
and methods:

[http://funny.computer/cloud/Random/zww_functions.txt](http://funny.computer/cloud/Random/zww_functions.txt)

The "sea" animation is controlled by "daSea" \-- "da" meaning "dynamic actor"
in Nintendo's naming terminology.

It's extremely unlikely they used texture distortion for the sea effect, since
the GPU they used didn't have fragment shaders -- the only method of texture
warping is INDTEXMTX, which was only used for the heat effects in Dragon Roost
Cavern.

They probably modified UVs directly on their triangular sea mesh.

Smoke effects and such use their in-house particle engine, "JPA".

~~~
kayamon
It's a common misconception that the Gamecube doesn't have fragment shaders.
The GPU (called the TEV) is almost a straight implementation of DirectX's
ps1.0, the same as a GeForce3, with a few extras added.

At my old company I wrote an assembler to read text source and assemble the
instructions into TEV format.

~~~
Jasper_
I'm aware of TEVs -- I did write
[http://magcius.github.io/bmdview.js/bmdview.html](http://magcius.github.io/bmdview.js/bmdview.html)
after all, which compiles TEV back into GL shaders :)

My point was more that TEVs can't modify texture coordinates, since
texcoordgen happens before the TEV stage. TEVs only specify how to blend
vertex colors, texture samples, game-set registers and lighting results
together using configurable formulas.

~~~
kayamon
It's been a while, but I seem to remember there was an additional indirect
texture unit for doing just this kind of stuff.

~~~
delroth
He mentioned this already:

> the only method of texture warping is INDTEXMTX, which was only used for the
> heat effects in Dragon Roost Cavern

------
avar
I was deeply into Nintendo games in the late 90s leading up to Wind Waker's
release. I remember after it was announced that so many people were deeply
disappointed in these "kiddy" graphics.

Remember that as far as the major releases go it was released in 2002 after
Ocarina of Time in 1998 (and a sequel using the same engine in 2000).

People wanted a "real" Zelda game with "real" graphics, like what became
Twilight Princess in 2006, whose graphics are a logical follow-up to Ocarina
of Time.

It's funny how history turns out, now Wind Waker is widely lauded for its
graphics, and it looks much better than the likes of Ocarina of Time or
Twilight Princess.

It's a fantastic example of how Nintendo is still a company that dares to
experiment, even with their most wildly successful game franchises. That
hasn't always worked out, but we've gotten amazing innovative games like Wind
Waker as a result.

~~~
dclowd9901
I remember the backlash, and it was bizarre, especially given this was the
first Zelda game that gave us _some_ semblance of continuity. But I also do
remember a Dolphin demo reel showing a more realistic Zelda that probably made
people think that's where the next game was going, so people were naturally
disappointed when their expectations were undermined.

~~~
yoklov
> the first Zelda game that gave us _some_ semblance of continuity

What continuity is there in WW? Nothing jumps to mind, especially when the
previous game (Majora's Mask) was essentially a direct sequel to OOT in
comparison.

~~~
einr
At one point you visit Hyrule Castle and there are allusions to Ocarina of
Time. I don't really remember the details but it is made clear in-game that
player Link is one in a series of Links.

~~~
wmil
Some of this is from memory, but it takes place on a timeline where Ganondorf
was sealed. Then Hyrule was flooded to prevent him from ever being unsealed.

The main character is dressed as Link because children dress as the great hero
once a year.

------
kemenaran
The compensation of the sea motion reminds me of how Zelda Link's Awakening
sea intro sequence was done on the Game Boy. It's suprising how two sea-themed
games can make use of the same techniques accross vastly different hardware :)

Here with some animated gifs: [http://kemenaran.winosx.com/posts/links-
awakening-rendering-...](http://kemenaran.winosx.com/posts/links-awakening-
rendering-the-opening-cutscene/) (disclaimer: I'm the author).

~~~
pygy_
That link is dead here... this works: [http://kzone.winosx.com/posts/links-
awakening-rendering-the-...](http://kzone.winosx.com/posts/links-awakening-
rendering-the-opening-cutscene/)

Edit: after reading said post, it's a great explanation of the techniques used
in Link's Awakening's intro. That game looked gorgeous on the B/W Gameboy,
it's cool to actually understand how they managed to pull it out technically.

~~~
DiThi
That link is not dead, just fainted on the shore.

------
qcoh
You might also enjoy [0] (which is based on [1]).

[0]: [https://simonschreibt.de/gat/zelda-wind-waker-hyrule-
travel-...](https://simonschreibt.de/gat/zelda-wind-waker-hyrule-travel-
guide/)

[1]: [http://polycount.com/discussion/104415/zelda-wind-waker-
tech...](http://polycount.com/discussion/104415/zelda-wind-waker-tech-and-
texture-analysis-picture-heavy)

------
bhauer
> _For the ultimate experience, I’d recommend listening to the incredibly
> uplifting soundtrack while reading on…_

In particular, skip ahead to 33:54 to start with the "Dawn" fanfare followed
by Wind Waker's fantastic Ocean sailing song.

[https://youtu.be/KnJiC8FeI2I?t=33m54s](https://youtu.be/KnJiC8FeI2I?t=33m54s)

------
sova
Good work. Wind Waker is a very beautiful game. I like that you discovered
that using the boat as the origin point for the ocean/waves makes the rest of
elevation computation that much easier.

------
komali2
The author mentions "two types of ocean." What's the other type? I don't
recall.

~~~
KwanEsq
The flat surface with waves that look a bit like ^ but wider and curvier. Seen
close to major islands like Windfall and the Forsaken Fortress

Example:
[http://zeldawiki.org/File:Zeldawindwaker01.jpg](http://zeldawiki.org/File:Zeldawindwaker01.jpg)

------
alpineidyll3
Great relaxing gfx-nerd chaser for a terrible week.

------
Rolpa
Here's a post on Polycount that analyzes other parts of the game:

[http://polycount.com/discussion/104415/zelda-wind-waker-
tech...](http://polycount.com/discussion/104415/zelda-wind-waker-tech-and-
texture-analysis-picture-heavy)

------
mmanfrin
Does anyone know of any other threejs talk/walkthrough posts? I love watching
the development of things with it, like this video:

[https://www.youtube.com/watch?v=db-7J5OaSag](https://www.youtube.com/watch?v=db-7J5OaSag)

~~~
mrdoob2
DOOM (2016) - Graphics Study
[http://www.adriancourreges.com/blog/2016/09/09/doom-2016-gra...](http://www.adriancourreges.com/blog/2016/09/09/doom-2016-graphics-
study/)

GTA V - Graphics Study [http://www.adriancourreges.com/blog/2015/11/02/gta-v-
graphic...](http://www.adriancourreges.com/blog/2015/11/02/gta-v-graphics-
study/)

------
panic
It'd be neat to compare this with what the game is actually doing (maybe using
the Dolphin emulator's debugger).

------
korijn
As a big fan of the Zelda series and a graphics geek, this was a very
interesting read!

------
cmrdporcupine
It's amazing how badly this game was trashed when it came out and how it's
come to be loved in retrospect.

If the designers had followed the trend at the time and gone for "realistic"
3d with textures it would look horribly dated now.

But they did the right thing and it has aged extremely well. And the re-
release looks great on the Wii U.

------
iaw
Wow, I hope to see a lot more of these in the future. It was a great read.

