| 1 |
#[vertex] |
| 2 |
|
| 3 |
#version 450 |
| 4 |
|
| 5 |
#VERSION_DEFINES |
| 6 |
|
| 7 |
layout(location = 0) out vec2 uv_interp; |
| 8 |
|
| 9 |
void main() { |
| 10 |
vec2 base_arr[3] = vec2[](vec2(-1.0, -3.0), vec2(-1.0, 1.0), vec2(3.0, 1.0)); |
| 11 |
uv_interp = base_arr[gl_VertexIndex]; |
| 12 |
gl_Position = vec4(uv_interp, 0.0, 1.0); |
| 13 |
} |
| 14 |
|
| 15 |
#[fragment] |
| 16 |
|
| 17 |
#version 450 |
| 18 |
|
| 19 |
#VERSION_DEFINES |
| 20 |
|
| 21 |
#include "../oct_inc.glsl" |
| 22 |
|
| 23 |
layout(location = 0) in vec2 uv_interp; |
| 24 |
layout(location = 0) out vec4 frag_color; |
| 25 |
|
| 26 |
layout(set = 0, binding = 0) uniform samplerCube source_cube; |
| 27 |
|
| 28 |
layout(push_constant, std430) uniform Params { |
| 29 |
float border_size; |
| 30 |
} |
| 31 |
params; |
| 32 |
|
| 33 |
void main() { |
| 34 |
vec3 dir = oct_to_vec3_with_border(uv_interp * 0.5 + 0.5, params.border_size); |
| 35 |
frag_color = vec4(texture(source_cube, dir).rgb, 1.0); |
| 36 |
} |