Skip to content

DDN: 2D & 3D Graphics

Daniel Livingston edited this page Dec 10, 2022 · 3 revisions

DDN: Implement 2D & 3D Graphics

Bevy will be used as the graphics backend.

Some benefits of Bevy:

  • Rust-native crate
  • Cross-platform + WebAssembly support

Proof-of-Concept

Before comprehensively designing the system architecture, a simple proof-of-concept will be developed. Lessons learned and insights gained from this demo app will greatly inform the final architecture design.

The proof-of-concept must satisfy the following criteria:

  1. A 2D Bevy app with true cross-platform support (incl. WebAssembly).
  2. The app demonstrates a core piece of functionality in RTA. For example, a guitar tuner, a visual MIDI client, or a Guitar Pro player.

Optionally,

  • The primary UI and windowing framework is egui; specifically, egui_bevy.

PoC Template

The proof-of-concept should be liberally inspired by this tutorial (which itself satisfies the above criteria): https://caballerocoll.com/blog/bevy-rhythm-game/

HelloBevy

The “hello world” of Bevy looks like:

use bevy::{input::system::exit_on_esc_system, prelude::*};

fn main() {
    App::build()
        // Set antialiasing to use 4 samples
        .add_resource(Msaa { samples: 4 })
        // Set WindowDescriptor Resource to change title and size
        .add_resource(WindowDescriptor {
            title: "Rhythm!".to_string(),
            width: 800.,
            height: 600.,
            ..Default::default()
        })
        .add_plugins(DefaultPlugins)
        .add_system(exit_on_esc_system.system())
        .run();
}
Clone this wiki locally