From 197bb7b78463f0ae8c4724ee0572f8321138b12b Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Mon, 6 Feb 2023 21:43:22 +0100 Subject: [PATCH] wip things --- kubi/shaders/world.frag | 4 ++++ kubi/src/gui.rs | 1 + kubi/src/gui/text_widget.rs | 0 kubi/src/main.rs | 2 ++ kubi/src/state.rs | 14 ++++++++++++++ 5 files changed, 21 insertions(+) create mode 100644 kubi/src/gui.rs create mode 100644 kubi/src/gui/text_widget.rs create mode 100644 kubi/src/state.rs diff --git a/kubi/shaders/world.frag b/kubi/shaders/world.frag index e07b5e1..566efaf 100644 --- a/kubi/shaders/world.frag +++ b/kubi/shaders/world.frag @@ -9,6 +9,10 @@ uniform sampler2DArray tex; void main() { // base color from texture color = texture(tex, vec3(v_uv, v_tex_index)); + // discard fully transparent pixels + if (color.w <= 0.0) { + discard; + } //basic "lighting" float light = abs(v_normal.x) + .8 * abs(v_normal.y) + .6 * abs(v_normal.z); color *= vec4(vec3(light), 1.); diff --git a/kubi/src/gui.rs b/kubi/src/gui.rs new file mode 100644 index 0000000..8ad1dfb --- /dev/null +++ b/kubi/src/gui.rs @@ -0,0 +1 @@ +//TODO diff --git a/kubi/src/gui/text_widget.rs b/kubi/src/gui/text_widget.rs new file mode 100644 index 0000000..e69de29 diff --git a/kubi/src/main.rs b/kubi/src/main.rs index 6af453e..5acfab8 100644 --- a/kubi/src/main.rs +++ b/kubi/src/main.rs @@ -31,6 +31,8 @@ pub(crate) mod block_placement; pub(crate) mod delta_time; pub(crate) mod cursor_lock; pub(crate) mod control_flow; +pub(crate) mod state; +pub(crate) mod gui; use world::{ init_game_world, diff --git a/kubi/src/state.rs b/kubi/src/state.rs new file mode 100644 index 0000000..642ea78 --- /dev/null +++ b/kubi/src/state.rs @@ -0,0 +1,14 @@ +use shipyard::Unique; + +#[derive(Unique)] +pub enum GameState { + Connecting, + LoadingWorld, + InGame, +} + +fn insert_default_state( + +) { + +}