WIP shadowmapping
This commit is contained in:
parent
2fdae1a23a
commit
ac67a3d4de
9 changed files with 270 additions and 122 deletions
17
res/shaders/depth.wgsl
Normal file
17
res/shaders/depth.wgsl
Normal file
|
@ -0,0 +1,17 @@
|
|||
#include globals.wgsl
|
||||
|
||||
@vertex
|
||||
fn vs_main(
|
||||
model: VertexInput,
|
||||
instance: InstanceInput,
|
||||
) -> @builtin(position) vec4<f32> {
|
||||
let model_matrix = mat4x4<f32>(
|
||||
instance.model_matrix_0,
|
||||
instance.model_matrix_1,
|
||||
instance.model_matrix_2,
|
||||
instance.model_matrix_3,
|
||||
);
|
||||
|
||||
let world_position = model_matrix * vec4<f32>(model.position, 1.0);
|
||||
return camera.proj * camera.view * world_position;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue