--wip-- [skip ci]

This commit is contained in:
2025-06-29 20:25:35 +01:00
parent f0d817f144
commit 69221df435
2 changed files with 19 additions and 35 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ layout(push_constant) uniform PushConstantData {
mat4 world; mat4 world;
vec3 dimensions; vec3 dimensions;
vec3 lowest_corner; vec3 lowest_corner;
uint enable[16*16*2]; uint enable[16*16/2];
} pc; } pc;
layout(set = 0, binding = 0) uniform Lights { layout(set = 0, binding = 0) uniform Lights {
+18 -34
View File
@@ -319,62 +319,46 @@ fn interval_check(csg: &CSG, push_constants: &mut PushConstantData) {
push_constants.dimensions = (highest_corner - lowest_corner).to_array().into(); push_constants.dimensions = (highest_corner - lowest_corner).to_array().into();
push_constants.lowest_corner = lowest_corner.into(); push_constants.lowest_corner = lowest_corner.into();
push_constants.enable = [0; 16 * 16 * 2]; push_constants.enable = [0; 16 * 16 / 2];
for x in 0..16 { for x in 0..16 {
for y in 0..16 { for y in 0..16 {
for z in 0..2 { for z in 0..2 {
let interval_input_z: Interval = Interval::new_unchecked( let interval_input_z: Interval = Interval::new_unchecked(
interpreter::Value::from_array([ interpreter::Value::from_array([
(((z as f32) / 2.0) (((z as f32) / 2.0) + (0.0 / 16.0)) * push_constants.dimensions[2]
+ (0.0 / 16.0)) * push_constants.dimensions[2]
+ push_constants.lowest_corner[2], + push_constants.lowest_corner[2],
(((z as f32) / 2.0) (((z as f32) / 2.0) + (1.0 / 16.0)) * push_constants.dimensions[2]
+ (1.0 / 16.0)) * push_constants.dimensions[2]
+ push_constants.lowest_corner[2], + push_constants.lowest_corner[2],
(((z as f32) / 2.0) (((z as f32) / 2.0) + (2.0 / 16.0)) * push_constants.dimensions[2]
+ (2.0 / 16.0)) * push_constants.dimensions[2]
+ push_constants.lowest_corner[2], + push_constants.lowest_corner[2],
(((z as f32) / 2.0) (((z as f32) / 2.0) + (3.0 / 16.0)) * push_constants.dimensions[2]
+ (3.0 / 16.0)) * push_constants.dimensions[2]
+ push_constants.lowest_corner[2], + push_constants.lowest_corner[2],
(((z as f32) / 2.0) (((z as f32) / 2.0) + (4.0 / 16.0)) * push_constants.dimensions[2]
+ (4.0 / 16.0)) * push_constants.dimensions[2]
+ push_constants.lowest_corner[2], + push_constants.lowest_corner[2],
(((z as f32) / 2.0) (((z as f32) / 2.0) + (5.0 / 16.0)) * push_constants.dimensions[2]
+ (5.0 / 16.0)) * push_constants.dimensions[2]
+ push_constants.lowest_corner[2], + push_constants.lowest_corner[2],
(((z as f32) / 2.0) (((z as f32) / 2.0) + (6.0 / 16.0)) * push_constants.dimensions[2]
+ (6.0 / 16.0)) * push_constants.dimensions[2]
+ push_constants.lowest_corner[2], + push_constants.lowest_corner[2],
(((z as f32) / 2.0) (((z as f32) / 2.0) + (7.0 / 16.0)) * push_constants.dimensions[2]
+ (7.0 / 16.0)) * push_constants.dimensions[2]
+ push_constants.lowest_corner[2], + push_constants.lowest_corner[2],
]), ]),
interpreter::Value::from_array([ interpreter::Value::from_array([
((((z as f32) / 2.0) (((z as f32) / 2.0) + (1.0 / 16.0)) * push_constants.dimensions[2]
+ (1.0 / 16.0)) * push_constants.dimensions[2]
+ push_constants.lowest_corner[2], + push_constants.lowest_corner[2],
(((z as f32) / 2.0) (((z as f32) / 2.0) + (2.0 / 16.0)) * push_constants.dimensions[2]
+ (2.0 / 16.0)) * push_constants.dimensions[2]
+ push_constants.lowest_corner[2], + push_constants.lowest_corner[2],
(((z as f32) / 2.0) (((z as f32) / 2.0) + (3.0 / 16.0)) * push_constants.dimensions[2]
+ (3.0 / 16.0)) * push_constants.dimensions[2]
+ push_constants.lowest_corner[2], + push_constants.lowest_corner[2],
(((z as f32) / 2.0) (((z as f32) / 2.0) + (4.0 / 16.0)) * push_constants.dimensions[2]
+ (4.0 / 16.0)) * push_constants.dimensions[2]
+ push_constants.lowest_corner[2], + push_constants.lowest_corner[2],
(((z as f32) / 2.0) (((z as f32) / 2.0) + (5.0 / 16.0)) * push_constants.dimensions[2]
+ (5.0 / 16.0)) * push_constants.dimensions[2]
+ push_constants.lowest_corner[2], + push_constants.lowest_corner[2],
(((z as f32) / 2.0) (((z as f32) / 2.0) + (6.0 / 16.0)) * push_constants.dimensions[2]
+ (6.0 / 16.0)) * push_constants.dimensions[2]
+ push_constants.lowest_corner[2], + push_constants.lowest_corner[2],
(((z as f32) / 2.0) (((z as f32) / 2.0) + (7.0 / 16.0)) * push_constants.dimensions[2]
+ (7.0 / 16.0)) * push_constants.dimensions[2]
+ push_constants.lowest_corner[2], + push_constants.lowest_corner[2],
(((z as f32) / 2.0) (((z as f32) / 2.0) + (8.0 / 16.0)) * push_constants.dimensions[2]
+ (8.0 / 16.0)) * push_constants.dimensions[2]
+ push_constants.lowest_corner[2], + push_constants.lowest_corner[2],
]), ]),
); );
@@ -1143,7 +1127,7 @@ impl App {
world: Mat4::IDENTITY.to_cols_array_2d(), world: Mat4::IDENTITY.to_cols_array_2d(),
dimensions: Vec3::ONE.to_array().into(), dimensions: Vec3::ONE.to_array().into(),
lowest_corner: Vec3::ZERO.into(), lowest_corner: Vec3::ZERO.into(),
enable: [0; 16], enable: [0; 16 * 16 / 2],
}; };
let uniform_data = implicit_vs::Camera { let uniform_data = implicit_vs::Camera {