Harbor

branch main
showing the latest snapshot on main
texture_advanced.luma 492 B · Plain text
shader/tests/shaders/texture_advanced.luma 0644 Raw
-- Test: sample_level and sample_shadow builtins

struct Params
    bias: float
end

uniform params: Params @group(0) @binding(0)
uniform diffuse_tex: sampler2D @group(0)
uniform shadow_map: sampler2DShadow @group(1)

@entry(fragment)
function fs_main(@location(0) uv: vec2, @location(1) shadow_uv: vec2) -> vec4
    let mip_color = sample_level(diffuse_tex, uv, params.bias)
    let shadow = sample_shadow(shadow_map, shadow_uv, 0.5)
    return vec4(mip_color.rgb * shadow, mip_color.a)
end