Move client/src/* to client/*

This commit is contained in:
Guillaume Meunier
2022-11-17 08:25:25 +01:00
parent ab2dd07105
commit f431543b47
81 changed files with 0 additions and 0 deletions
+64
View File
@@ -0,0 +1,64 @@
/*
* WiVRn VR streaming
* Copyright (C) 2022 Guillaume Meunier <guillaume.meunier@centraliens.net>
* Copyright (C) 2022 Patrick Nicolas <patricknicolas@laposte.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#version 450
#ifdef VERT_SHADER
vec2 positions[3] = vec2[](
vec2(-1.0, -1.0),
vec2(3.0, -1.0),
vec2(-1.0, 3.0));
layout(location = 0) out vec2 outUV;
layout(set = 0, binding = 1) uniform UniformBufferObject
{
mat4 reprojection;
}
ubo;
void main()
{
// outUV = vec2(ubo.reprojection * vec4(positions[gl_VertexIndex], 1.0, 1.0));
outUV = positions[gl_VertexIndex];
gl_Position = vec4(positions[gl_VertexIndex], 0.0, 1.0);
}
#endif
#ifdef FRAG_SHADER
layout(set = 0, binding = 0) uniform sampler2D texSampler;
layout(set = 0, binding = 1) uniform UniformBufferObject
{
mat4 reprojection;
}
ubo;
layout(location = 0) in vec2 inUV;
layout(location = 0) out vec4 outColor;
void main()
{
vec4 tmp = ubo.reprojection * vec4(inUV, 1.0, 1.0);
outColor = texture(texSampler, vec2(tmp) / tmp.z * 0.5 + vec2(0.5, 0.5));
}
#endif
+70
View File
@@ -0,0 +1,70 @@
/*
* WiVRn VR streaming
* Copyright (C) 2022 Guillaume Meunier <guillaume.meunier@centraliens.net>
* Copyright (C) 2022 Patrick Nicolas <patricknicolas@laposte.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#version 450
#ifdef VERT_SHADER
vec2 positions[3] = vec2[](
vec2(-1.0, -1.0),
vec2(3.0, -1.0),
vec2(-1.0, 3.0));
vec2 uvs[3] = vec2[](
vec2(0.0, 0.0),
vec2(2.0, 0.0),
vec2(0.0, 2.0));
layout(location = 0) out vec2 outUV;
void main()
{
outUV = uvs[gl_VertexIndex];
gl_Position = vec4(positions[gl_VertexIndex], 0.0, 1.0);
}
#endif
#ifdef FRAG_SHADER
layout(binding = 0) uniform sampler2D texSampler;
layout(location = 0) in vec2 inUV;
layout(location = 0) out vec4 outColor;
float sRGB_to_linear(float x)
{
if (x <= 0.04045)
return x / 12.92;
return pow((x + 0.055) / 1.055, 2.4);
}
vec4 sRGB_to_linear_rgba(vec4 x)
{
return vec4(
sRGB_to_linear(x.r),
sRGB_to_linear(x.g),
sRGB_to_linear(x.b),
x.a
);
}
void main()
{
outColor = sRGB_to_linear_rgba(texture(texSampler, inUV));
}
#endif
+62
View File
@@ -0,0 +1,62 @@
/*
* WiVRn VR streaming
* Copyright (C) 2022 Guillaume Meunier <guillaume.meunier@centraliens.net>
* Copyright (C) 2022 Patrick Nicolas <patricknicolas@laposte.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#version 450
#ifdef VERT_SHADER
layout (std140, push_constant) uniform UBO
{
mat4 model_view_projection;
} instance;
vec2 uv[6] = vec2[](
vec2(0.0, 0.0),
vec2(1.0, 0.0),
vec2(0.0, 1.0),
vec2(1.0, 0.0),
vec2(0.0, 1.0),
vec2(1.0, 1.0)
);
layout (location = 0) out vec2 outUV;
void main()
{
vec4 position = vec4(uv[gl_VertexIndex], 0.0, 1.0);
outUV = vec2(uv[gl_VertexIndex].x, 1.0 - uv[gl_VertexIndex].y);
gl_Position = instance.model_view_projection * position;
}
#endif
#ifdef FRAG_SHADER
layout(set = 0, binding = 0) uniform sampler2D texSampler;
layout(location = 0) in vec2 texcoord0;
layout(location = 0) out vec4 outColor;
void main()
{
outColor = vec4(texture(texSampler, texcoord0).rrr, 1.0);
}
#endif
+62
View File
@@ -0,0 +1,62 @@
/*
* WiVRn VR streaming
* Copyright (C) 2022 Guillaume Meunier <guillaume.meunier@centraliens.net>
* Copyright (C) 2022 Patrick Nicolas <patricknicolas@laposte.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#version 450
#ifdef VERT_SHADER
layout(location = 0) in vec3 in_position;
layout(location = 1) in vec3 in_normal;
layout(location = 2) in vec2 in_texcoord0;
layout(set = 1, binding = 0) uniform UBO
{
mat4 model_view;
mat4 projection;
}
instance;
layout(location = 0) out vec4 normal;
layout(location = 1) out vec2 texcoord0;
void main()
{
normal = instance.model_view * vec4(in_normal, 0.0);
texcoord0 = texcoord0;
gl_Position = instance.projection * instance.model_view * vec4(in_position, 1.0);
}
#endif
#ifdef FRAG_SHADER
layout(set = 0, binding = 0) uniform sampler2D base_color;
layout(set = 1, binding = 0) uniform UBO
{
mat4 model_view;
mat4 projection;
}
instance;
layout(location = 0) in vec4 normal;
layout(location = 1) in vec2 texcoord0;
void main()
{
}
#endif