#[set = 3]
struct StandardLayout {
#![stage(MISS | CLOSEST_HIT | RAYGEN)]
img_illuminance: StorageImage<RGBA16_Float>,
img_illuminance_denoised: StorageImage<RGBA16_Float>,
img_albedo: StorageImage<RGB10A2_UNorm>,
img_normal: StorageImage<RGB10A2_UNorm>,
img_depth: StorageImage<R32_Float>,
img_motion: StorageImage<RGBA16_Float>,
img_voxel_id: StorageImage<R32_UInt>,
blue_noise: [SampledImage; 6],
sunlight_config: UniformBuffer<ArHosekSkyModelConfiguration>,
camera_last_frame: UniformBuffer<CameraSettings>,
camera: UniformBuffer<CameraSettings>,
instances: StorageBuffer<[Mat4]>,
spatial_hash: StorageBuffer<[SpatialHashEntry]>,
surfel_pool: StorageBuffer<[SurfelEntry]>,
#[binding = 14]
acceleration_structure: AccelerationStructure,
}
#[push_constants]
struct PushConstants {
#![stage(MISS | CLOSEST_HIT | RAYGEN)]
rand: u32,
frame_index: u32,
}
struct SurfelEntry {
position: IVec3,
direction: u32, // [0, 6) indicating one of the six faces of the cube
}
struct SpatialHashEntry {
fingerprint: u32,
last_accessed_frame: u16,
sample_count: u16,
radiance: Vec3<f16>,
visual_importance: f16,
}
struct CameraSettings {
view_proj: Mat4,
inverse_view_proj: Mat4,
camera_view_col0: Vec3,
position_x: f32,
camera_view_col1: Vec3,
position_y: f32,
camera_view_col2: Vec3,
position_z: f32,
tan_half_fov: f32,
far: f32,
near: f32,
_padding: f32,
}
struct ArHosekSkyModelChannelConfiguration {
configs0: Vec4,
configs1: Vec4,
configs2: f32,
radiance: f32,
ld_coefficient0: f32,
ld_coefficient1: f32,
ld_coefficient2: Vec4,
}
struct ArHosekSkyModelConfiguration {
r: ArHosekSkyModelChannelConfiguration,
g: ArHosekSkyModelChannelConfiguration,
b: ArHosekSkyModelChannelConfiguration,
direction: Vec4, // normalized.
solar_intensity: Vec4, // w is solar radius
}