Files
HelloVulkan/shaders/tonemap.vert
T
atdunbg 908e688178 feat: ACES tonemap + Bloom 后处理链(Extract/BlurH/BlurV 半分辨率)
- ACES(Narkowicz) 经 push 开关启用,exposure 接 ImGui 滑条
- RG: TextureDesc 支持 sizeScale 相对尺寸;per-pass 渲染尺寸解析
  (半分辨率 pass 的 viewport 由此决定)
- RG Toposort 重写:RAW+WAR+WAW 按声明序逐资源建边,支持多写者
  ping-pong 资源(旧逻辑对 reader 连接所有 writer,ping-pong 成环)
- GetPhysicalView 缺物理镜像时 throw(ENGINE_FATAL 只记日志不中止)
- 全屏 pass 通用 16B push + 公共录制 lambda,Extract/Blur/Tonemap 复用
2026-09-22 19:18:51 +08:00

24 lines
693 B
GLSL
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#version 450
// 全屏三角形:无顶点缓冲,从 gl_VertexIndex 派生 UV。
// 0 → (-1,3)? 经典三角覆盖整个屏幕:
// idx0:(-1,-1) idx1:(3,-1) idx2:(-1,3),UV 相应 [0..2],
// 光栅化插值后屏幕内 UV 恰好落在 [0,1]。
layout(location = 0) out vec2 fragUV;
// 全屏 pass 通用 push(16B,与 tonemap.frag 及所有全屏 pass 一致,VUID-08878)
layout(push_constant) uniform PushConstants {
float exposure;
float aces;
float _pad0;
float _pad1;
} pc;
void main() {
vec2 p = vec2(
float((gl_VertexIndex << 1) & 2),
float(gl_VertexIndex & 2));
fragUV = p;
gl_Position = vec4(p * 2.0 - 1.0, 0.0, 1.0);
}