From db477e5fedc19e1f19ab5384c3c6ade51c81e93c Mon Sep 17 00:00:00 2001 From: FreddyFunk <27208977+FreddyFunk@users.noreply.github.com> Date: Sun, 25 Feb 2024 22:04:33 +0100 Subject: [PATCH] debug camera position --- src/apps/ray_marching_renderer.rs | 4 ++-- src/apps/slice_renderer_shader.wgsl | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/apps/ray_marching_renderer.rs b/src/apps/ray_marching_renderer.rs index 42e32ee..15335a5 100644 --- a/src/apps/ray_marching_renderer.rs +++ b/src/apps/ray_marching_renderer.rs @@ -5,7 +5,7 @@ use eframe::{ egui_wgpu::{self, wgpu}, }; use egui::{epaint::Shadow, Pos2}; -use glam::{vec3, Vec2}; +use glam::{vec3, vec4, Vec2, Vec3, Vec4}; struct RayMarchingRendererResources { render_pipeline: wgpu::RenderPipeline, @@ -642,7 +642,7 @@ impl RayMarchingRenderer { impl RayMarchingRenderer { pub fn custom_painting(&mut self, ui: &mut egui::Ui) { let available_size = ui.available_size_before_wrap(); - let (rect, _response) = + let (rect, response) = ui.allocate_exact_size(available_size, egui::Sense::click_and_drag()); // Clone locals so we can move them into the paint callback: diff --git a/src/apps/slice_renderer_shader.wgsl b/src/apps/slice_renderer_shader.wgsl index 69f09f4..1ee5854 100644 --- a/src/apps/slice_renderer_shader.wgsl +++ b/src/apps/slice_renderer_shader.wgsl @@ -52,5 +52,6 @@ fn get_value(position: vec2) -> vec3 { fn fs_main(in: VertexOutput) -> @location(0) vec4 { let position = in.tex_coords; let value = textureSample(t_diffuse, s_diffuse, get_value(position))[0]; - return vec4(value, value, value, 1.0); + //return vec4(value, value, value, 1.0); + return vec4(position.x, position.y, 0.0, 1.0); }