- 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
22 lines
683 B
GLSL
22 lines
683 B
GLSL
#version 450
|
||
|
||
// 天空盒像素:NDC → 世界方向 → cube 采样。
|
||
// invVP = inverse(projNoJitter × mat4(mat3(view))):去掉平移的视图,
|
||
// 反投影结果即"相机相对"的世界方向,normalize 后直接采样 cube。
|
||
|
||
layout(location = 0) in vec2 fragUV;
|
||
layout(location = 0) out vec4 outColor;
|
||
|
||
layout(set = 0, binding = 0) uniform samplerCube envMap;
|
||
|
||
// push 与 skybox.vert 一致声明(VUID-08878)
|
||
layout(push_constant) uniform PushConstants {
|
||
mat4 invVP;
|
||
} pc;
|
||
|
||
void main() {
|
||
vec4 target = pc.invVP * vec4(fragUV * 2.0 - 1.0, 1.0, 1.0);
|
||
vec3 dir = normalize(target.xyz / target.w);
|
||
outColor = vec4(texture(envMap, dir).rgb, 1.0);
|
||
}
|