use bevy::prelude::*;
use bevy::render::render_resource::{Extent3d, TextureDimension, TextureFormat};
#[derive(Resource)]
pub struct ProceduralTextures {
pub white_pixel: Handle<Image>,
}
pub fn init_procedural_textures(mut commands: Commands, mut images: ResMut<Assets<Image>>) {
let white_pixel = Image::new_fill(
Extent3d {
width: 1,
height: 1,
depth_or_array_layers: 1,
},
TextureDimension::D2,
&[255, 255, 255, 255], TextureFormat::Rgba8UnormSrgb,
Default::default(), );
let white_pixel_handle = images.add(white_pixel);
commands.insert_resource(ProceduralTextures {
white_pixel: white_pixel_handle,
});
info!("Procedural textures initialized");
}