Expand description
§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.
All colors and the texture mask are taken from The Legend of Zelda: The Wind Waker.
Differences to The Wind Waker:
- This shader supports multiple light sources, like in Breath of the Wild. The original Wind Waker only supports a single light source.
- 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.
Keep in mind this shader only replicates what is seen on the characters in The Wind Waker, not the environment!
§Example
use bevy::prelude::*;
use bevy_wind_waker_shader::prelude::*;
fn main() {
App::new()
.add_plugins((DefaultPlugins, WindWakerShaderPlugin::default()))
.add_systems(Startup, spawn_character)
.run();
}
fn spawn_character(mut commands: Commands, asset_server: Res<AssetServer>) {
commands.spawn((
SceneRoot(asset_server.load("models/Fox.glb")),
WindWakerShaderBuilder::default()
.time_of_day(TimeOfDay::Day)
.weather(Weather::Sunny)
.build(),
));
}
§Compatibility
bevy | bevy_wind_waker_shader |
---|---|
0.15 | 0.3 |
0.14 | 0.2 |
0.13 | 0.1 |
Modules§
- prelude
- Everything you need to get started with the Wind Waker shader. For the main feature, see WindWakerShaderBuilder.
Structs§
- Wind
Waker Shader - Build via the
WindWakerShaderBuilder
and insert into an entity to give it a shader that looks like the one used by characters in The Legend of Zelda: The Wind Waker. - Wind
Waker Shader Builder - Builds a new
WindWakerShader
by setting the parameters to look like those in The Legend of Zelda: The Wind Waker. After insertion, the shader will be moved into theExtendedMaterial
of the entity. If the entity in question is aScene
, this is done for all the entities inside the scene. - Wind
Waker Shader Plugin - Plugin for the Wind Waker shader.
Enums§
- Time
OfDay - The time of day used for the color palette in the
WindWakerShaderBuilder
. Note that this does not have to correspond to any actual time settings in your game. Rather, think of this as “mood categories” that you can use to set the color palette. - Weather
- The weather used for the color palette in the
WindWakerShaderBuilder
. Note that this does not have to correspond to any actual weather settings in your game. Rather, think of this as “mood categories” that you can use to set the color palette.
Type Aliases§
- Extended
Material - The type of the material that will be inserted for you after you insert the
WindWakerShader
via theWindWakerShaderBuilder
into an entity.