From 91880d88fe20e00c46aa280e0afded849a177469 Mon Sep 17 00:00:00 2001 From: atdunbg Date: Wed, 23 Sep 2026 11:35:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20tonemap=20=E8=BE=93=E5=87=BA=E9=A2=84?= =?UTF-8?q?=E4=B9=98=20alpha=20=E5=8C=B9=E9=85=8D=20PRE=5FMULTIPLIED=20?= =?UTF-8?q?=E5=90=88=E6=88=90=E6=A8=A1=E5=BC=8F=20+=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E5=9C=B0=E9=9D=A2=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/main.cpp | 6 +++--- shaders/tonemap.frag | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/App/main.cpp b/App/main.cpp index 98947e9..e6dbead 100644 --- a/App/main.cpp +++ b/App/main.cpp @@ -47,14 +47,14 @@ protected: EnableImGui(); // 模型资产(AssetManager 负责加载/缓存/生命周期,返回句柄) - auto backpack = GetAssets().LoadModel("assets/models/backpack/backpack.obj"); + const auto backpack = GetAssets().LoadModel("assets/models/backpack/backpack.obj"); // 地面:程序化纯色平面(半边长 15,中心 y=-2) - auto ground = GetAssets().CreatePlane(15.0f, 140, 140, 145); + const auto ground = GetAssets().CreatePlane(15.0f, 140, 140, 145); m_Ground = scene.CreateEntity("Ground"); m_Ground.AddComponent() - .SetPosition(glm::vec3(0.0f, -4.5f, 0.0f)) + .SetPosition(glm::vec3(0.0f, -0.5f, 0.0f)) .Compose(); m_Ground.AddComponent(MeshRendererComponent{ground}); diff --git a/shaders/tonemap.frag b/shaders/tonemap.frag index 6fcb462..8e98a3c 100644 --- a/shaders/tonemap.frag +++ b/shaders/tonemap.frag @@ -35,5 +35,5 @@ void main() { ? acesFilm(hdr) : clamp(hdr, 0.0, 1.0); - outColor = vec4(pow(mapped, vec3(1.0 / 2.2)), alpha); + outColor = vec4(pow(mapped, vec3(1.0 / 2.2)) * alpha, alpha); }