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,

Large diffs are not rendered by default. Showing the first 50 of 145 lines. Show full diff