tirbofish/dropbear · diff
fix: general bug fixes with textures. refactor officially done, time to merge Unverified
@@ -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); @@ -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, @@ -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