Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/janhohenheim/bevy_wind_waker_shader
A toon shader that looks like the one used for characters in The Legend of Zelda: The Wind Waker
https://github.com/janhohenheim/bevy_wind_waker_shader
bevy game-development rust zelda
Last synced: 6 days ago
JSON representation
A toon shader that looks like the one used for characters in The Legend of Zelda: The Wind Waker
- Host: GitHub
- URL: https://github.com/janhohenheim/bevy_wind_waker_shader
- Owner: janhohenheim
- License: apache-2.0
- Created: 2024-01-25T18:16:53.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-07-04T17:22:33.000Z (6 months ago)
- Last Synced: 2024-12-08T05:23:35.599Z (15 days ago)
- Topics: bevy, game-development, rust, zelda
- Language: Rust
- Homepage:
- Size: 8.04 MB
- Stars: 46
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license-apache.txt
Awesome Lists containing this project
README
# Wind Waker Shader
[![crates.io](https://img.shields.io/crates/v/bevy_wind_waker_shader)](https://crates.io/crates/bevy_wind_waker_shader)
[![docs.rs](https://docs.rs/bevy_wind_waker_shader/badge.svg)](https://docs.rs/bevy_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](https://www.youtube.com/watch?v=mnxs6CR6Zrk).## Showcase
Sphere:
![Sphere](https://github.com/janhohenheim/bevy_wind_waker_shader/assets/9047632/c5493f3e-fd09-4795-b62c-aa6b33a23089)
Scene throughout day:
Scene in daylight:
![Scene in daylight](https://github.com/janhohenheim/bevy_wind_waker_shader/assets/9047632/664c3830-c053-408d-9444-29a10004c60e)
Scene at night:
![Scene at night](https://github.com/janhohenheim/bevy_wind_waker_shader/assets/9047632/4e483e73-2c8e-4a0c-a9cf-c4ea8b182a4f)
## 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
```rust,no_run
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) {
commands.spawn((
SceneBundle {
scene: asset_server.load("models/Fox.glb"),
..default()
},
WindWakerShaderBuilder::default()
.time_of_day(TimeOfDay::Afternoon)
.weather(Weather::Sunny)
.build(),
));
}
```## Compatibility
| bevy | bevy_wind_waker_shader |
|-------------|------------------------|
| 0.14 | 0.2 |
| 0.13 | 0.1 |