fixes to uvs

wip on custom chunk shader
This commit is contained in:
2024-04-02 23:31:45 -04:00
parent 83dbf82478
commit 0bcf65b0b1
5 changed files with 79 additions and 11 deletions

View File

@@ -1,4 +1,5 @@
use bevy::prelude::*;
use bevy::window::PresentMode;
use bevy_inspector_egui::quick::WorldInspectorPlugin;
mod phos;
mod prelude;
@@ -13,11 +14,8 @@ fn main() {
title: "Phos".into(),
name: Some("phos".into()),
resolution: (1920.0, 1080.0).into(),
resizable: false,
enabled_buttons: bevy::window::EnabledButtons {
maximize: false,
..Default::default()
},
resizable: true,
present_mode: PresentMode::AutoNoVsync,
..default()
}),
..default()

View File

@@ -1,3 +1,5 @@
use bevy::pbr::MaterialExtension;
use bevy::render::render_resource::{AsBindGroup, ShaderRef};
use bevy::{pbr::CascadeShadowConfig, prelude::*};
use camera_system::PhosCameraPlugin;
use iyes_perf_ui::prelude::*;
@@ -166,3 +168,16 @@ fn create_map(
commands.insert_resource(heightmap);
}
#[derive(Asset, TypePath, AsBindGroup, Debug, Clone)]
struct ChunkMaterial {
#[texture(0, dimension = "2d_array")]
#[sampler(1)]
array_texture: Handle<Image>,
}
impl MaterialExtension for ChunkMaterial {
fn fragment_shader() -> ShaderRef {
"shaders/world/chunk.wgsl".into()
}
}