Skip to content

Defernus/bevy_old_tv_shader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bevy_old_tv_shader

An "old TV" effect based on the Bevy post-processing example.

Movie of the old TV shader effect in action on 'cube' example.

Usage

To use this effect, add the crate to your project.

Add the crate

cargo add --git https://github.com/Defernus/bevy_old_tv_shader.git

Add the plugin

# use bevy::prelude::*;
# use bevy_old_tv_shader::prelude::*;
fn main() {
    App::new()
        .add_plugins((DefaultPlugins, OldTvPlugin))
        .update();
}

Add the settings to the camera

This effect will only appear on cameras with an OldTvSettings component.

# use bevy::prelude::*;
# use bevy_old_tv_shader::prelude::*;
fn setup_camera(mut commands: Commands) {
    // camera
    commands.spawn((
        Camera3d::default(),
        OldTvSettings {
            screen_shape_factor: 0.2,
            rows: 64.0,
            brightness: 3.0,
            edges_transition_size: 0.025,
            channels_mask_min: 0.1,
        },
    ));
}

Features

"ui"

Applies the effect to the UI and text as well.

Examples

cube, 3d camera

The "cube" example shows a rotating cube with the effect (shown above).

cargo run --example cube

shapes, 2d camera

The "shapes" example shows 2d shapes.

cargo run --example shapes

shapes

text

The "text" example shows UI text with or without the effect.

No effect on UI

cargo run --example text

Effect on UI

cargo run  --features ui --example text

text

The "text" example also accepts an argument of "3d-camera". This was mainly used to spotcheck that the effect worked with a 3d camera.

Effect on UI with 3d camera

cargo run  --features ui --example text 3d-camera

Compatibility

bevy_old_tv_shader bevy
0.2.0 0.15
0.1.0 0.8

License

This crate is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •