kitgit

tirbofish/dropbear · commit

35f91581bdbeb16a11a2517ba90d7f6c67388bb6

fix: general bug fixes with textures. refactor officially done, time to merge Unverified

Thribhu K <4tkbytes@pm.me> · 2026-01-18 12:39

view full diff

diff --git a/crates/dropbear-engine/src/lighting.rs b/crates/dropbear-engine/src/lighting.rs
index 33c7115..74e7d4d 100644
--- a/crates/dropbear-engine/src/lighting.rs
+++ b/crates/dropbear-engine/src/lighting.rs
@@ -271,7 +271,10 @@ impl Light {
         label: Option<&str>,
     ) -> Self {
         let forward = DVec3::new(0.0, 0.0, -1.0);
-        let direction = transform.rotation * forward;
+        let mut direction = transform.rotation * forward;
+        if matches!(light.light_type, LightType::Directional) {
+            direction = -direction;
+        }
 
         let uniform = LightUniform {
             position: dvec3_to_uniform_array(transform.position),
@@ -340,7 +343,10 @@ impl Light {
         self.uniform.position = dvec3_to_uniform_array(transform.position);
 
         let forward = DVec3::new(0.0, 0.0, -1.0);
-        let direction = transform.rotation * forward;
+        let mut direction = transform.rotation * forward;
+        if matches!(light.light_type, LightType::Directional) {
+            direction = -direction;
+        }
         self.uniform.direction =
             dvec3_direction_to_uniform_array(direction, light.outer_cutoff_angle);
 
diff --git a/crates/dropbear-engine/src/pipelines/light_cube.rs b/crates/dropbear-engine/src/pipelines/light_cube.rs
index 8caccc2..6a599a9 100644
--- a/crates/dropbear-engine/src/pipelines/light_cube.rs
+++ b/crates/dropbear-engine/src/pipelines/light_cube.rs
@@ -71,8 +71,8 @@ impl DropbearShaderPipeline for LightCubePipeline {
             primitive: wgpu::PrimitiveState {
                 topology: wgpu::PrimitiveTopology::TriangleList,
                 strip_index_format: None,
-                front_face: wgpu::FrontFace::Ccw,
-                cull_mode: Some(wgpu::Face::Back),
+                front_face: wgpu::FrontFace::Cw,
+                    cull_mode: Some(wgpu::Face::Back),
                 polygon_mode: wgpu::PolygonMode::Fill,
                 unclipped_depth: false,
                 conservative: false,
diff --git a/crates/dropbear-engine/src/pipelines/shader.rs b/crates/dropbear-engine/src/pipelines/shader.rs
index eaa8a1d..e165009 100644
--- a/crates/dropbear-engine/src/pipelines/shader.rs
+++ b/crates/dropbear-engine/src/pipelines/shader.rs
@@ -66,7 +66,7 @@ impl DropbearShaderPipeline for MainRenderPipeline {
                     primitive: wgpu::PrimitiveState {
                         topology: wgpu::PrimitiveTopology::TriangleList,
                         strip_index_format: None,
-                        front_face: wgpu::FrontFace::Ccw,
+                        front_face: wgpu::FrontFace::Cw,
                         cull_mode: Some(wgpu::Face::Back),
                         polygon_mode: wgpu::PolygonMode::Fill,
                         unclipped_depth: false,
diff --git a/crates/eucalyptus-core/src/scripting.rs b/crates/eucalyptus-core/src/scripting.rs
index 4926101..0b5b333 100644
--- a/crates/eucalyptus-core/src/scripting.rs
+++ b/crates/eucalyptus-core/src/scripting.rs
@@ -723,7 +723,7 @@ pub async fn build_jvm(
 
     let gradle_cmd = get_gradle_command(project_root);
 
-    let _ = status_sender.send(BuildStatus::Building(format!("Running: {}", gradle_cmd)));
+    let _ = status_sender.send(BuildStatus::Building(format!("Running: {} fatJar", gradle_cmd)));
 
     let mut child = Command::new(&gradle_cmd)
         .current_dir(project_root)
diff --git a/crates/redback-runtime/src/scene.rs b/crates/redback-runtime/src/scene.rs
index 4299975..91475b5 100644
--- a/crates/redback-runtime/src/scene.rs
+++ b/crates/redback-runtime/src/scene.rs
@@ -2,7 +2,7 @@ use std::sync::Arc;
 
 use std::collections::HashMap;
 use dropbear_engine::pipelines::DropbearShaderPipeline;
-use eucalyptus_core::egui::{CentralPanel, MenuBar, TopBottomPanel};
+use eucalyptus_core::egui::CentralPanel;
 use eucalyptus_core::physics::collider::ColliderGroup;
 use eucalyptus_core::physics::collider::ColliderShapeKey;
 use eucalyptus_core::physics::collider::shader::ColliderInstanceRaw;
@@ -367,10 +367,10 @@ impl Scene for PlayMode {
         if let Some(l) = &mut self.light_cube_pipeline {
             l.update(graphics.clone(), &self.world);
         }
-        
+
         #[cfg(feature = "debug")]
-        TopBottomPanel::top("menu_bar").show(&graphics.get_egui_context(), |ui| {
-            MenuBar::new().ui(ui, |ui| {
+        egui::TopBottomPanel::top("menu_bar").show(&graphics.get_egui_context(), |ui| {
+            egui::MenuBar::new().ui(ui, |ui| {
                 ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| {
                     ui.group(|ui| {
                         ui.add_enabled_ui(true, |ui| {
@@ -564,11 +564,29 @@ impl Scene for PlayMode {
         }
 
         {
+            let _ = frame_ctx.encoder.begin_render_pass(&wgpu::RenderPassDescriptor {
+                label: Some("runtime surface clear pass"),
+                color_attachments: &[Some(wgpu::RenderPassColorAttachment {
+                    view: &frame_ctx.view,
+                    depth_slice: None,
+                    resolve_target: None,
+                    ops: wgpu::Operations {
+                        load: wgpu::LoadOp::Clear(clear_color),
+                        store: wgpu::StoreOp::Store,
+                    },
+                })],
+                depth_stencil_attachment: None,
+                occlusion_query_set: None,
+                timestamp_writes: None,
+            });
+        }
+
+        {
             let mut render_pass = frame_ctx.encoder
                 .begin_render_pass(&wgpu::RenderPassDescriptor {
                     label: Some("light cube render pass"),
                     color_attachments: &[Some(wgpu::RenderPassColorAttachment {
-                        view: &frame_ctx.view,
+                        view: &graphics.viewport_texture.view,
                         depth_slice: None,
                         resolve_target: None,
                         ops: wgpu::Operations {
@@ -619,7 +637,7 @@ impl Scene for PlayMode {
                 .begin_render_pass(&wgpu::RenderPassDescriptor {
                     label: Some("model render pass"),
                     color_attachments: &[Some(wgpu::RenderPassColorAttachment {
-                        view: &frame_ctx.view,
+                        view: &graphics.viewport_texture.view,
                         depth_slice: None,
                         resolve_target: None,
                         ops: wgpu::Operations {
@@ -668,7 +686,7 @@ impl Scene for PlayMode {
                         .begin_render_pass(&wgpu::RenderPassDescriptor {
                             label: Some("model render pass"),
                             color_attachments: &[Some(wgpu::RenderPassColorAttachment {
-                                view: &frame_ctx.view,
+                                view: &graphics.viewport_texture.view,
                                 depth_slice: None,
                                 resolve_target: None,
                                 ops: wgpu::Operations {