We got exr loading
This commit is contained in:
@@ -15,21 +15,15 @@ layout(push_constant) uniform SkyboxPC {
|
||||
|
||||
void main()
|
||||
{
|
||||
// Fullscreen-triangle trick gives uv in [0..2]. Convert to [0..1].
|
||||
vec2 uv01 = uv * 0.5;
|
||||
vec2 ndcXY = uv * 2.0 - 1.0;
|
||||
|
||||
// Build an NDC point on the far plane.
|
||||
// Vulkan NDC is x,y in [-1..1], z in [0..1]. Using z=1 means "far".
|
||||
vec4 ndc = vec4(uv01 * 2.0 - 1.0, 1.0, 1.0);
|
||||
vec4 ndc = vec4(ndcXY, 1.0, 1.0);
|
||||
|
||||
// Unproject to world space
|
||||
vec4 world = pcs.invViewProj * ndc;
|
||||
vec3 worldPos = world.xyz / world.w;
|
||||
|
||||
// Direction from camera through this pixel
|
||||
vec3 dir = normalize(worldPos - pcs.cameraPos.xyz);
|
||||
dir.y *= -1.0;
|
||||
|
||||
// Sample cubemap directly
|
||||
outColor = sampleTextureCubeLinear(pcs.skyboxTextureId, dir);
|
||||
// outColor = sampleTextureCubeNearest(pcs.skyboxTextureId, dir);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user