Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Toon Shader for the bevy game engine

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
NotificationsYou must be signed in to change notification settings

tbillington/bevy_toon_shader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crates.ioMIT/Apache 2.0

Atoon shader for theBevy game engine.

bevy_toon_shader

Features

  • "Sun" color & direction
  • Specular highlight
  • Light banding
  • Shadow casting
  • Albedo map (base color texture)

Not supported (yet)

  • Dynamic color banding amount
  • Shadow receiving
  • Rim lighting

Installation

cargo add bevy_toon_shader
use bevy::prelude::*;use bevy_toon_shader::{ToonShaderMainCamera,ToonShaderMaterial,ToonShaderPlugin,ToonShaderSun};fnmain(){App::new().add_plugins(DefaultPlugins).add_plugin(ToonShaderPlugin).add_systems(Startup, setup).run();}fnsetup(mutcommands:Commands,mutmeshes:ResMut<Assets<Mesh>>,muttoon_materials:ResMut<Assets<ToonShaderMaterial>>,){// Camera    commands.spawn((Camera3dBundle{/* ... */},ToonShaderMainCamera,));// Sun    commands.spawn((DirectionalLightBundle{/* ... */},ToonShaderSun,));// Ambient light    commands.insert_resource(AmbientLight{color:Color::GRAY*0.2,        ..default()});let material = toon_materials.add(ToonShaderMaterial::default());// 3D object    commands.spawn(MaterialMeshBundle{mesh: meshes.add(Mesh::try_from(shape::Torus::default()).unwrap()),transform:Transform::from_xyz(0.,2.,0.),material: toon_material,        ..default()});}

Running the example

git clone https://github.com/tbillington/bevy_toon_shader.gitcd bevy_toon_shadercargo run --example scene

Bevy Support Table

bevybevy_toon_shader
0.120.3
0.110.2
0.100.1

Credit

Code initially adapted from thisexcellent Unity tutorial by Roystan.

License

Except where noted, all code in this repository is dual-licensed under either:

at your option.This means you can select the license you prefer!This dual-licensing approach is the de-facto standard in the Rust ecosystem and there arevery good reasons to include both.

Your contributions

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

Toon Shader for the bevy game engine

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Sponsor this project

 

[8]ページ先頭

©2009-2025 Movatter.jp