This commit is contained in:
2026-02-24 17:29:48 +08:00
parent 26e00f9fea
commit 205fb2da8c
6 changed files with 227 additions and 14 deletions

29
shader/panel.frag Normal file
View File

@@ -0,0 +1,29 @@
#version 330 core
in vec3 vWorldPos;
in vec3 vWorldNormal;
out vec4 FragColor;
uniform bool uLightMode;
void main() {
vec3 N = normalize(vWorldNormal);
float isTop = step(0.75, N.y);
vec3 topBase;
vec3 sideBase;
if (uLightMode) {
// 浅色主题 偏亮的工业灰
topBase = vec3(0.78, 0.80, 0.84);
sideBase = vec3(0.68, 0.70, 0.74);
}
else {
// 深色主题 偏暗的工业灰
topBase = vec3(0.30, 0.31, 0.32);
sideBase = vec3(0.27, 0.28, 0.29);
}
vec3 baseColor = mix(sideBase, topBase, isTop);
FragColor = vec4(clamp(baseColor, 0.0, 1.0), 1.0);
}