-
Notifications
You must be signed in to change notification settings - Fork 1
VoxelPBRFrustumCulling
github-actions[bot] edited this page Aug 19, 2026
·
1 revision
OpenGL 图形编程任务中最复杂的一道:在保持像素风格的同时正确实现 PBR、实例化绘制与可观察、可验证的 CPU 视锥剔除。
渲染一个类 Minecraft 的像素方块场景(严格 250 个方块:225 个地面方块 + 5 根柱子),使用 C++、GLFW、GLAD、GLM 与 nlohmann-json,以 OpenGL 4.6 core profile 为目标:
- Cook-Torrance metallic-roughness PBR 与线性颜色工作流;
brushed_metal/red_plastic两种固定材质由materials.json经 nlohmann-json 解析并校验后作为唯一真源 - 严格
32 x 32的程序化材质纹理(base-color / normal / ORM);主场景先渲染到640 x 360离屏目标,再以GL_NEAREST放大到窗口 - 程序化 IBL:HDR environment cubemap、irradiance、5-mip prefilter 与 BRDF LUT(split-sum approximation)
- directional sun shadow map(≥
2048 x 2048、3×3 PCF)+ 4 个 point light;Reinhard/ACES tone mapping 与 gamma correction - 实例化绘制(主场景每帧 cube draw call ≤
2次)、CPU 视锥剔除(C开关,可见实例数可降至0)、标题栏实时统计、5 种 debug view - 所有 GLSL shader 必须作为独立 UTF-8 文本文件由程序读取,禁止嵌入 C++ 源码