A toon shader that looks like the one used for characters in The Legend of Zelda: The Wind Waker
Wind Waker Shader
A toon shader that looks like the one used for characters in The Legend of Zelda: The Wind Waker. The main code is taken from the ideas presented in this video.
Showcase
Sphere:
Scene throughout day:
Scene in daylight:
Scene at night:
Functionality
The shader has the following properties:
- It is a toon shader with only two colors: the highlight and the shadow.
- The edge between the two colors is not entirely hard but has an ever-so-slight gradient.
- The color palette used is based on the time of day and the weather.
- The model has a rim highlight on the edge to make it pop.
Differences to The Wind Waker:
- This shader supports multiple light sources, like in Breath of the Wild. The original Wind Waker only supports a
- The rim highlight also comes from Breath of the Wild.
- The Wind Waker uses even more weather conditions, but I find most of them too specific to include in this shader.
Example
,no_run
use bevy::prelude::*;
use bevywindwaker_shader::prelude::*;
fn main() { App::new() .add_plugins((DefaultPlugins, WindWakerShaderPlugin::default())) .addsystems(Startup, spawncharacter) .run(); }
fn spawncharacter(mut commands: Commands, assetserver: Res<AssetServer>) { commands.spawn(( SceneRoot(asset_server.load("models/Fox.glb")), WindWakerShaderBuilder::default() .timeofday(TimeOfDay::Day) .weather(Weather::Sunny) .build(),
)); }
Compatibility
| bevy | bevywindwaker_shader | |-------------|------------------------| | 0.18 | 0.6 | | 0.17 | 0.5 | | 0.16 | 0.4 | | 0.15 | 0.3 | | 0.14 | 0.2 | | 0.13 | 0.1 |