feat: 透明窗口支持 + 退出确认流程 + ImGui 总开关
用户自主改进批次: - 透明窗口:GLFW_TRANSPARENT_FRAMEBUFFER + 窗口 opacity 0.5, swapchain composite alpha 按能力自适应(Opaque/Pre/PostMultiplied), Forward 清屏 alpha=0,tonemap 透传 HDR alpha——物体实体、背景透明 - 退出确认:Window 挂 WindowCloseCallback 发事件,App 侧 OnWindowClose 置确认标记,OnRenderOverlay 弹 ImGui 确认框后 Close(); 主循环退出条件改为 m_Running(close 事件驱动) - ImGui 总开关:` 键切换 ImGuiLayer::SetEnabled,禁用时跳过 NewFrame/OnRenderOverlay/BuildDrawData 整段 - 帧率控制简化:去掉 LimitFps 开关,非 vsync 时恒按 target 限帧 (默认 60,可调 ≥24);m_VSync 默认 false(Mailbox 不限速) - 清理:Model.cpp const 修正,swapchain 日志带 present mode, GPU 遥测暂时注释 验证:0 error 0 warning,composite alpha 实测选 PreMultiplied(0x2), present=Mailbox
This commit is contained in:
@@ -25,8 +25,9 @@ vec3 acesFilm(vec3 x) {
|
||||
|
||||
void main() {
|
||||
// bloom 在 HDR 域叠加(半分辨率模糊图线性采样上采样)
|
||||
vec3 hdr = texture(hdrImage, fragUV).rgb
|
||||
+ texture(bloomImage, fragUV).rgb * pc.bloomStrength;
|
||||
vec4 hdrTex = texture(hdrImage, fragUV);
|
||||
vec3 hdr = hdrTex.rgb + texture(bloomImage, fragUV).rgb * pc.bloomStrength;
|
||||
float alpha = hdrTex.a;
|
||||
|
||||
hdr *= pc.exposure;
|
||||
|
||||
@@ -34,5 +35,5 @@ void main() {
|
||||
? acesFilm(hdr)
|
||||
: clamp(hdr, 0.0, 1.0);
|
||||
|
||||
outColor = vec4(pow(mapped, vec3(1.0 / 2.2)), 1.0);
|
||||
outColor = vec4(pow(mapped, vec3(1.0 / 2.2)), alpha);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user