godot/servers/rendering/renderer_rd/shaders/cubemap_downsampler_inc.glsl
Rémi Verschelde 18d6b75ba8
RendererRD: Remove binding specifier for push constants
This is unsupported and glslang made it raise an error in 11.7.0:
https://github.com/KhronosGroup/glslang/pull/2810

Co-authored-by: Clay John <claynjohn@gmail.com>
2022-02-11 18:42:32 +01:00

49 lines
846 B
GLSL

layout(push_constant, std430) uniform Params {
uint face_size;
uint face_id; // only used in raster shader
}
params;
#define M_PI 3.14159265359
void get_dir_0(out vec3 dir, in float u, in float v) {
dir[0] = 1.0;
dir[1] = v;
dir[2] = -u;
}
void get_dir_1(out vec3 dir, in float u, in float v) {
dir[0] = -1.0;
dir[1] = v;
dir[2] = u;
}
void get_dir_2(out vec3 dir, in float u, in float v) {
dir[0] = u;
dir[1] = 1.0;
dir[2] = -v;
}
void get_dir_3(out vec3 dir, in float u, in float v) {
dir[0] = u;
dir[1] = -1.0;
dir[2] = v;
}
void get_dir_4(out vec3 dir, in float u, in float v) {
dir[0] = u;
dir[1] = v;
dir[2] = 1.0;
}
void get_dir_5(out vec3 dir, in float u, in float v) {
dir[0] = -u;
dir[1] = v;
dir[2] = -1.0;
}
float calcWeight(float u, float v) {
float val = u * u + v * v + 1.0;
return val * sqrt(val);
}