ibl.h

cross platform rendering playground

src/scene/ibl.h

823 B
#pragma once

#include "backend/rhi.h"
#include "core/globals.h"

struct FrameGraph;

struct QuickSubmit;

struct EnvMap {
    rhi::Image environment_img;
    rhi::ImageView environment_view;

    rhi::Image irradiance_img;
    rhi::ImageView irradiance_view;

    rhi::Image prefiltered_img;
    rhi::ImageView prefiltered_view;

    rhi::Image brdf_lut_img;
    rhi::ImageView brdf_lut_view;

    u64 environmentIdx; // cubemap handle (rhi::handle_id)
    u64 irradianceIdx;  // irradiance map handle
    u64 prefilteredIdx; // prefiltered specular handle
    u64 brdfLutIdx;     // brdf lut handle
    u32 prefilter_mip_count;
};

void GenerateIBL(
    rhi::Device &device,
    QuickSubmit &qs,
    rhi::ShaderCompiler &sc,
    EnvMap &out,
    FrameGraph &fg,
    rhi::ImageView &hdr_view,
    u64 samp_linear_clamp
);