Reorganize directory layout: editor panels/, grouped shaders, drop stale header
- App/editor: move 7 panels into panels/ (Editor core stays at root) - shaders/: group into pbr/ post/ debug/ env/ (runtime load paths updated) - Delete outdated duplicate Engine/src/Renderer/VulkanAssetUploader.h
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
#version 450
|
||||
|
||||
// Bloom 提取:从 HDR 颜色图中滤出超过阈值的部分(软阈值,保留超出比例)。
|
||||
// 全屏 pass 通用 push(16B):param0 = 亮度阈值(HDR 域,1.0 = 仅高光溢出)。
|
||||
|
||||
layout(location = 0) in vec2 fragUV;
|
||||
layout(location = 0) out vec4 outColor;
|
||||
|
||||
layout(set = 0, binding = 0) uniform sampler2D hdrImage;
|
||||
|
||||
layout(push_constant) uniform PushConstants {
|
||||
float exposure; // 未用(程序级统一布局)
|
||||
float threshold; // param0
|
||||
float _pad0;
|
||||
float _pad1;
|
||||
} pc;
|
||||
|
||||
void main() {
|
||||
// 5 tap 十字预滤波(中心 0.4 + 四邻 0.15):TAA 残留的亚像素震荡
|
||||
// 在进阈值前被抹平——1px 级抖动的能量摊到 ~4×4 足印,泛光不再脉冲。
|
||||
// 半分辨率输出中心的双线性已覆盖 2×2 块,此步把足印扩到近似 4×4
|
||||
vec2 ts = 1.0 / vec2(textureSize(hdrImage, 0));
|
||||
vec3 c = texture(hdrImage, fragUV).rgb * 0.4
|
||||
+ (texture(hdrImage, fragUV + vec2(ts.x, 0.0)).rgb
|
||||
+ texture(hdrImage, fragUV + vec2(-ts.x, 0.0)).rgb
|
||||
+ texture(hdrImage, fragUV + vec2(0.0, ts.y)).rgb
|
||||
+ texture(hdrImage, fragUV + vec2(0.0, -ts.y)).rgb) * 0.15;
|
||||
|
||||
float l = max(c.r, max(c.g, c.b));
|
||||
|
||||
// 软阈值:只保留超出 threshold 的能量比例,避免硬切产生的块状边缘
|
||||
float k = max(l - pc.threshold, 0.0) / max(l, 1e-4);
|
||||
outColor = vec4(c * k, 1.0);
|
||||
}
|
||||
Reference in New Issue
Block a user