WIP shadowmapping

This commit is contained in:
Lauri Räsänen 2023-01-30 00:40:50 +02:00
parent 43b4eaf5ab
commit c5e32a830d
7 changed files with 145 additions and 91 deletions

View file

@ -11,6 +11,8 @@ var<uniform> camera: CameraUniform;
struct Light {
position: vec3<f32>,
color: vec4<f32>,
matrices: array<mat4x4<f32>, 6>,
active_matrix: u32,
}
@group(1) @binding(0)
var<uniform> light: Light;
@ -39,13 +41,12 @@ struct VertexOutput {
@location(1) tangent_position: vec3<f32>,
@location(2) tangent_light_position: vec3<f32>,
@location(3) tangent_view_position: vec3<f32>,
@location(4) world_position: vec3<f32>,
@location(5) light_local_position: vec4<f32>,
@location(4) world_position: vec4<f32>,
}
// Fragment shader
@group(1)@binding(1)
var t_light_depth: texture_depth_2d;
var t_light_depth: binding_array<texture_depth_2d>;
@group(1) @binding(2)
var s_light_depth: sampler_comparison;
var s_light_depth: binding_array<sampler_comparison>;