bevy_magic_fx/
shader_variant.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
use bevy::{prelude::*, utils::HashMap};
use serde::{Deserialize, Serialize};



//this gets loaded in

//this ends up as pub shader_variant_materials: HashMap<String, Handle<AnimatedMaterial>>,

//pub type ShaderVariant = AnimatedMaterial;

#[derive(Debug, Clone, Asset, Serialize, Deserialize)]
pub struct ShaderVariantManifest {
   
    pub texture: String,
    pub masking_texture: Option<String>,

    pub animation_speed: Vec2,
    pub distortion_speed: Vec2,

    pub scroll_repeats: Vec2,

    pub distortion_amount: f32,

    pub color: LinearRgba,
    pub emissive: LinearRgba,
 
    pub depth_cutoff_offset: Option<f32> ,   // use depth bias for this ? 

    pub fresnel_power: Option<f32>,

    pub animation_frame_dimensions: Option<[u32;2]>
}

impl TypePath for ShaderVariantManifest {
    fn short_type_path() -> &'static str {
        "shadvar.ron"
    }
    fn type_path() -> &'static str {
        "shadvar.ron"
    }
}