A Bevy plugin that provides authentic PlayStation 1 (PSX) style rendering capabilities, including low-resolution rendering, vertex snapping, and palette quantization.
- Low-Resolution Rendering: Classic PSX resolutions (320x240, 512x448, etc.)
- Vertex Snapping: Authentic PSX-style geometry jitter
- Palette Quantization: Optional retro color limitations (off by default)
- Pixelated Upscaling: Nearest-neighbor or linear filtering
- Automatic Material Conversion: Works seamlessly with standard Bevy materials
use bevy::prelude::*;
use bevy_psx::prelude::*;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugins(PsxCameraPlugin)
.add_systems(Startup, setup)
.run();
}
fn setup(mut commands: Commands) {
commands.spawn((
Camera3d::default(),
Transform::from_xyz(4.0, 2.5, 4.0).looking_at(Vec3::ZERO, Vec3::Y),
PsxCamera, // Enables PSX rendering!
));
}fn configure_psx(mut settings: ResMut<PsxRenderSettings>) {
settings.render_resolution = UVec2::new(320, 240);
settings.pixelated = true;
settings.aspect_ratio_matching = true;
}fn configure_vertex_snapping(mut settings: ResMut<PsxSettings>) {
settings.snap_enabled = true;
settings.snap_amount = 64.0; // Lower = more jittery
}Snap Amount Guide:
8.0-32.0: Extreme jitter (very wobbly)64.0: Classic PSX feel (recommended)128.0+: Subtle effect
fn configure_palette(mut settings: ResMut<PsxSettings>) {
settings.use_palette = true;
settings.quantize_steps = 32;
}cargo run --example simple_psxcargo run --example lightsThe most comprehensive example with physical camera, multiple light types, and all PSX features.
cargo run --example object_spawnerStress test with up to 1000 objects.
Rendering:
1-4: Switch resolutionsA: Toggle aspect ratio matchingF: Toggle pixelated filtering
PSX Effects:
V/B: Adjust vertex snappingP: Toggle palette quantizationN/M: Switch palettesT: Toggle vertex snapping
Note: Each example may have slightly different controls - check console output when running.
- PSX: 320×240 (4:3)
- PS2: 512×448 (8:7)
- SNES: 256×224 (8:7)
MIT License
- Bevy: 0.17.2
- Platforms: All Bevy-supported platforms