mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 22:31:05 +00:00
4cb120e878
There are some missing parts from this commit as these are the fairly clean changes. Missing is building a separate set of pipelines for the new render pass (might be able to get away from that), OIT heads texture is flat rather than an array, view matrices aren't set up, and the fisheye renderer isn't hooked up to the output pass (code exists but is messy). However, with the missing parts included, testing shows things mostly working: the cube map is rendered correctly even though it's not displayed correctly (incorrect view). This has definitely proven to be a good test for Vulkan's multiview feature (very nice).
30 lines
729 B
GLSL
30 lines
729 B
GLSL
#version 450
|
|
#extension GL_GOOGLE_include_directive : enable
|
|
|
|
layout (set = 0, binding = 0) uniform
|
|
#include "matrices.h"
|
|
;
|
|
|
|
layout (set = 1, binding = 0) uniform samplerCube Input;
|
|
|
|
layout (push_constant) uniform PushConstants {
|
|
float fov;
|
|
float aspect;
|
|
};
|
|
|
|
layout (location = 0) in vec2 uv;
|
|
|
|
layout (location = 0) out vec4 frag_color;
|
|
|
|
void
|
|
main ()
|
|
{
|
|
// slight offset on y is to avoid the singularity straight ahead
|
|
vec2 xy = (2.0 * uv - vec2 (1, 1.00002)) * (vec2(1, -aspect));
|
|
float r = sqrt (dot (xy, xy));
|
|
vec2 cs = vec2 (cos (r * fov), sin (r * fov));
|
|
vec3 dir = vec3 (cs.y * xy / r, cs.x);
|
|
|
|
vec4 c = texture (Input, dir);
|
|
frag_color = c;// * 0.001 + vec4(dir, 1);
|
|
}
|