cvkg-render-gpu 0.3.2

Cyber Viking Kvasir Graph (CVKG) - High-fidelity agentic UI framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Shadow shader — depth-only rendering for cascaded shadow maps.
//! Renders 3D meshes to a depth texture from the light's perspective.

// Vertex shader for shadow map rendering (3D meshes)
// Uses the same VertexInput3D as material_pbr.wgsl but outputs depth only
@vertex
fn vs_shadow(in: VertexInput3D) -> @builtin(position) vec4<f32> {
    let model = mat4x4<f32>(
        in.model_row0,
        in.model_row1,
        in.model_row2,
        vec4<f32>(0.0, 0.0, 0.0, 1.0)
    );
    
    // Use light_vp from SceneUniforms for shadow map projection
    let light_pos = scene.light_vp * model * vec4<f32>(in.position, 1.0);
    return light_pos;
}