From 487cf3184385181a6395f0bc81e5d7be63d62d04 Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Tue, 7 May 2024 01:14:36 +0200 Subject: [PATCH] wip --- kubi/src/rendering/selection_box.rs | 66 +++----------------- kubi/src/rendering/selection_box/pipeline.rs | 0 2 files changed, 8 insertions(+), 58 deletions(-) create mode 100644 kubi/src/rendering/selection_box/pipeline.rs diff --git a/kubi/src/rendering/selection_box.rs b/kubi/src/rendering/selection_box.rs index ad89716..c434527 100644 --- a/kubi/src/rendering/selection_box.rs +++ b/kubi/src/rendering/selection_box.rs @@ -1,59 +1,9 @@ -// use glam::{Mat4, Vec3, Quat}; -// use shipyard::{View, IntoIter, NonSendSync, UniqueViewMut, UniqueView}; -// use glium::{ -// Surface, -// DrawParameters, -// BackfaceCullingMode, -// Blend, Depth, DepthTest, -// uniform, -// }; -// use crate::{ -// world::raycast::LookingAtBlock, -// camera::Camera, -// prefabs::ColoredShaderPrefab -// }; -// use super::{ -// RenderTarget, -// primitives::cube::CubePrimitive, -// }; +mod pipeline; -// const SMOL: f32 = 0.0025; - -// pub fn render_selection_box( -// lookat: View, -// camera: View, -// mut target: NonSendSync>, -// program: NonSendSync>, -// buffers: NonSendSync>, -// ) { -// let camera = camera.iter().next().unwrap(); -// let Some(lookat) = lookat.iter().next() else { return }; -// let Some(lookat) = lookat.0 else { return }; - -// //Darken block -// target.0.draw( -// &buffers.0, -// &buffers.1, -// &program.0, -// &uniform! { -// color: [0., 0., 0., 0.5_f32], -// model: Mat4::from_scale_rotation_translation( -// Vec3::splat(1. + SMOL * 2.), -// Quat::default(), -// lookat.block_position.as_vec3() - Vec3::splat(SMOL) -// ).to_cols_array_2d(), -// perspective: camera.perspective_matrix.to_cols_array_2d(), -// view: camera.view_matrix.to_cols_array_2d(), -// }, -// &DrawParameters { -// backface_culling: BackfaceCullingMode::CullClockwise, -// blend: Blend::alpha_blending(), -// depth: Depth { -// //this may be unreliable... unless scale is applied! hacky... -// test: DepthTest::IfLessOrEqual, -// ..Default::default() -// }, -// ..Default::default() -// } -// ).unwrap(); -// } +pub fn draw_selection_box( + ctx: &mut RenderCtx, + lookat: View, + camera: View, +) { + //TODO +} diff --git a/kubi/src/rendering/selection_box/pipeline.rs b/kubi/src/rendering/selection_box/pipeline.rs new file mode 100644 index 0000000..e69de29