#bevy #shader #graphics #gamedev #game-engine #object

bevy_terminal_shader

An old school terminal shader for the bevy game engine

1 unstable release

0.1.0 Jan 9, 2024

#1604 in Game dev

MIT OR Apache-2.0 OR CC0-1.0

1.5MB
102 lines

bevy_terminal_shader

Maintenance CI crates-io api-docs

This crate provides a old school terminal-like effect that can be applied to 2D and 3D objects on the bevy game engine.

Terminal shader example

Install

cargo add bevy_terminal_shader

Usage

Add plugin to app

use bevy::prelude::*;
fn main() {
    App::new()
        .add_plugins(bevy_terminal_shader::TerminalShaderPlugin)
        .run()
}

Add settings to camera

use bevy::prelude::*;

fn setup(
    mut commands: Commands,
    mut meshes: ResMut<Assets<Mesh>>,
    mut materials: ResMut<Assets<TerminalMaterial>>) {
    commands.spawn(Camera2dBundle::default());
    
    commands.spawn(MaterialMesh2dBundle {
        mesh: meshes
            .add(shape::Quad::new(Vec2::new(1300., 800.)).into())
            .into(),
        material: materials.add(TerminalMaterial::green()),
        ..default()
    });

Example

Run the "quad" example like so:

cargo run --example quad

This will show a large quad like the one shown at the beginning of this README.

cargo run --example cube

This will show a rotating cube with the shader as its surfaces.

License

This crate is licensed under the MIT License or the Apache License 2.0 or CC0 License.

Acknowlegments

Dependencies

~21MB
~391K SLoC