Skip to content

displaced-lobster/bevy-toon-material

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bevy Toon Material

A work-in-progress toon material for the Bevy game engine.

Toon material example

Usage

Add plugin and use material:

use bevy::prelude::*;
use bevy_toon_material::{ToonMaterial, ToonMaterialPlugin};

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_plugin(ToonMaterialPlugin)
        .add_startup_system(setup)
        .run();
}

fn setup(
    mut commands: Commands,
    mut meshes: ResMut<Assets<Mesh>>,
    mut materials: ResMut<Assets<ToonMaterial>>,
) {
    commands.spawn(MaterialMeshBundle {
        mesh: meshes.add(Mesh::from(shape::UVSphere::default())),
        material: materials.add(ToonMaterial {
            color: Color::rgb(0.1, 0.1, 0.6),
            glossiness: 5.0,
            ..default()
        }),
        ..default()
    });

    commands.spawn(PointLightBundle {
        point_light: PointLight {
            range: 100.0,
            shadows_enabled: true,
            ..default()
        },
        transform: Transform::from_xyz(8.0, 16.0, 8.0),
        ..default()
    });

    commands.spawn(Camera3dBundle {
        transform: Transform::from_xyz(0.0, 2.5, 12.0).looking_at(Vec3::ZERO, Vec3::Y),
        ..default()
    });
}

See the examples folder for more detail usage.

Examples

$ cargo run --examples point_light_demo

Roadmap

  • Convert to library - IN PROGRESS

  • Add base color texture

  • Add outlines?

  • Add normal map?

Reference

About

A work-in-progress toon material for the Bevy game engine.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages