├── .gitignore ├── CHANGELOG.md ├── Cargo.toml ├── LICENSE ├── examples ├── cube.rs ├── shapes.rs └── text.rs ├── README.md ├── src ├── old_tv.wgsl └── lib.rs └── Cargo.lock /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | .vscode 3 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. 4 | 5 | ## [unreleased] 6 | 7 | ## [0.2.0] - 2025-02-01 8 | 9 | - Add support for bevy 0.15. 10 | - Add movie and usage, example, license, compatibility sections to README. 11 | 12 | ## [0.1.0] - 2022-08-04 13 | 14 | - Initial commit for bevy 0.8. 15 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "bevy_old_tv_shader" 3 | description = "An \"old TV\" post-processing effect" 4 | authors = ["Denis Lavrentev"] 5 | repository = "https://github.com/Defernus/bevy_old_tv_shader" 6 | version = "0.4.0" 7 | edition = "2021" 8 | keywords = [ 9 | "bevy", 10 | "gamedev", 11 | "shader", 12 | ] 13 | categories = [ 14 | "game-development" 15 | ] 16 | readme = "README.md" 17 | license = "MIT" 18 | 19 | [dependencies] 20 | bevy = { version = "^0.17", default-features = false, features = [ "bevy_pbr", "bevy_sprite_render" ] } 21 | bevy_ui = { version = "^0.17", optional = true } 22 | bevy_ui_render = { version = "^0.17", optional = true } 23 | 24 | [dev-dependencies] 25 | bevy = { version = "^0.17" } 26 | 27 | [features] 28 | ui = ["dep:bevy_ui", "dep:bevy_ui_render"] 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012-2022 Scott Chacon and others 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /examples/cube.rs: -------------------------------------------------------------------------------- 1 | use bevy::prelude::*; 2 | use bevy_old_tv_shader::prelude::*; 3 | 4 | /// Set up a simple 3D scene 5 | fn setup( 6 | mut commands: Commands, 7 | mut meshes: ResMut>, 8 | mut materials: ResMut>, 9 | ) { 10 | // camera 11 | commands.spawn(( 12 | Camera3d::default(), 13 | Transform::from_translation(Vec3::new(0.0, 0.0, 5.0)).looking_at(Vec3::default(), Vec3::Y), 14 | Camera { 15 | clear_color: Color::WHITE.into(), 16 | ..default() 17 | }, 18 | // Add the setting to the camera. 19 | // This component is also used to determine on which camera to run the post processing effect. 20 | OldTvSettings { 21 | screen_shape_factor: 0.2, 22 | rows: 64.0, 23 | brightness: 3.0, 24 | edges_transition_size: 0.025, 25 | channels_mask_min: 0.1, 26 | }, 27 | )); 28 | 29 | // cube 30 | commands.spawn(( 31 | Mesh3d(meshes.add(Cuboid::default())), 32 | MeshMaterial3d(materials.add(Color::srgb(0.8, 0.7, 0.6))), 33 | Transform::from_xyz(0.0, 0.0, 0.0), 34 | Rotates, 35 | )); 36 | // light 37 | commands.spawn(DirectionalLight { 38 | illuminance: 1_000., 39 | ..default() 40 | }); 41 | } 42 | 43 | #[derive(Component)] 44 | struct Rotates; 45 | 46 | /// Rotates any entity around the x and y axis 47 | fn rotate(time: Res