kitgit

tirbofish/dropbear · diff

8d20f7f · Thribhu K

damn allat just for me having to return back to wgsl :( at least i did get **some** slang compat to work, but looks like wgsl is the way to go. merging to the ui branch to continue on with ui. i do have a neat little tool tho... Unverified

diff --git a/crates/dropbear-engine/src/pipelines/shaders/blit.wgsl b/crates/dropbear-engine/src/pipelines/shaders/blit.wgsl
deleted file mode 100644
index bd6b79b..0000000
--- a/crates/dropbear-engine/src/pipelines/shaders/blit.wgsl
+++ /dev/null
@@ -1,28 +0,0 @@
-struct VertexOutput {
-    @builtin(position) clip_position: vec4<f32>,
-    @location(0) uv: vec2<f32>,
-}
-
-@group(0) @binding(0)
-var tex: texture_2d<f32>;
-@group(0) @binding(1)
-var tex_sampler: sampler;
-
-@vertex
-fn vs_main(
-    @builtin(vertex_index) in_vertex_index: u32,
-) -> VertexOutput {
-    var out: VertexOutput;
-
-    let x = f32((in_vertex_index << 1u) & 2u);
-    let y = f32(in_vertex_index & 2u);
-    out.clip_position = vec4<f32>(x * 2.0 - 1.0, y * 2.0 - 1.0, 0.0, 1.0);
-    out.uv = vec2<f32>(x, 1.0 - y);
-    return out;
-}
-
-@fragment
-fn fs_main(in: VertexOutput) -> @location(0) vec4<f32> {
-    let s = textureSample(tex, tex_sampler, in.uv);
-    return s;
-}
\ No newline at end of file
diff --git a/crates/dropbear-engine/src/pipelines/shaders/dropbear.slang b/crates/dropbear-engine/src/pipelines/shaders/dropbear.slang
index 11a2cfe..ff6f1d2 100644
--- a/crates/dropbear-engine/src/pipelines/shaders/dropbear.slang
+++ b/crates/dropbear-engine/src/pipelines/shaders/dropbear.slang
@@ -1,3 +1,8 @@
+struct Globals {
+    uint num_lights;
+    float ambient_strength;
+};
+
 /// A standard light descriptor struct. 
 struct Light {
     float4 position;
@@ -16,6 +21,14 @@ struct CameraUniform {
     float4x4 view_proj;

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