Files
HelloVulkan/shaders/env/skybox.vert
T
atdunbg f73e52926f 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
2026-10-07 09:52:17 +08:00

22 lines
734 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
// 天空盒顶点:全屏三角形(无顶点缓冲),UV 交给 fragment 反投影。
// 方向在 fragment 逐像素计算(invVP 是投影变换,对 NDC 线性插值方向
// 不精确;UV 插值是仿射的,逐像素重建方向零误差)。
layout(location = 0) out vec2 fragUV;
// push 与 skybox.frag 一致声明(VUID-08878:shader object 接口一致)
layout(push_constant) uniform PushConstants {
mat4 invVP;
} pc;
void main() {
vec2 p = vec2(
float((gl_VertexIndex << 1) & 2),
float(gl_VertexIndex & 2));
fragUV = p;
// 远平面:z = 1(Vulkan [0,1] 深度),无深度附件,只关心覆盖屏幕
gl_Position = vec4(p * 2.0 - 1.0, 1.0, 1.0);
}