[shaders] Move shaders to another repo (submodule) (#260)

This commit is contained in:
Nick Renieris 2018-05-24 14:43:29 +03:00 committed by GitHub
parent 233b01d178
commit 8b50c0b967
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
50 changed files with 7 additions and 654 deletions

3
.gitmodules vendored
View File

@ -37,3 +37,6 @@
[submodule "src/external/googletest"]
path = src/external/googletest
url = https://github.com/google/googletest.git
[submodule "src/emulator/shaders-db"]
path = src/emulator/shaders-db
url = https://github.com/Vita3K/shaders-db.git

View File

@ -85,7 +85,7 @@ if(APPLE)
add_custom_command(
TARGET emulator
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/shaders" "$<TARGET_FILE_DIR:emulator>/../Resources/shaders"
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/shaders-db/shaders" "$<TARGET_FILE_DIR:emulator>/../Resources/shaders"
COMMAND ${CMAKE_COMMAND} -E copy_directory "${PROJECT_SOURCE_DIR}/src/external/sdl/macos/SDL2.framework" "$<TARGET_FILE_DIR:emulator>/../Frameworks/SDL2.framework")
set_target_properties(emulator PROPERTIES LINK_FLAGS "-rpath @executable_path/../Frameworks/")
target_sources(emulator PRIVATE Vita3K.icns)
@ -94,13 +94,13 @@ elseif(LINUX)
add_custom_command(
TARGET emulator
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/shaders" "$<TARGET_FILE_DIR:emulator>/shaders")
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/shaders-db/shaders" "$<TARGET_FILE_DIR:emulator>/shaders")
elseif(WIN32)
target_sources(emulator PRIVATE resource.h Vita3K.ico Vita3K.rc)
add_custom_command(
TARGET emulator
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/shaders" "$<TARGET_FILE_DIR:emulator>/shaders"
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/shaders-db/shaders" "$<TARGET_FILE_DIR:emulator>/shaders"
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${PROJECT_SOURCE_DIR}/src/external/sdl/windows/lib/x64/SDL2.dll" "$<TARGET_FILE_DIR:emulator>"
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${PROJECT_SOURCE_DIR}/src/external/unicorn/windows/unicorn.dll" "$<TARGET_FILE_DIR:emulator>"
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${PROJECT_SOURCE_DIR}/src/external/unicorn/windows/libgcc_s_seh-1.dll" "$<TARGET_FILE_DIR:emulator>"

@ -0,0 +1 @@
Subproject commit a389b4b3cff57abb7ed0233d4b1aa959560b73b7

View File

@ -1,15 +0,0 @@
// https://github.com/Rinnegatamante/vitaQuake/blob/master/shaders/modulate_rgba_fog_f.cg
#version 410
uniform sampler2D tex;
in vec4 vColor;
in vec2 vTexcoord;
in float vFog;
out vec4 fragColor;
void main()
{
vec4 c = texture(tex, vTexcoord) * vColor;
c.rgb = c.rgb *vFog;
fragColor = c;
}

View File

@ -1,18 +0,0 @@
// Vertex shader.
#version 410
in vec4 inputaPosition;
in vec4 inputaColour;
in vec2 inputaTexCoord;
uniform mat4 gm_Matrices[5];
out vec4 vColor;
out vec2 vTexCoord;
void main()
{
gl_Position = gm_Matrices[4] * inputaPosition;
vColor = inputaColour;
vTexCoord = inputaTexCoord;
}

View File

@ -1,11 +0,0 @@
// https://github.com/Rinnegatamante/vitaQuake/blob/master/shaders/rgba_alpha_f.cg
#version 410
in vec4 vColor;
out vec4 fragColor;
void main()
{
if (vColor.a > 0.666) fragColor = vColor;
else discard;
}

View File

@ -1,11 +0,0 @@
// Fragment shader.
#version 410
in vec4 vColor;
out vec4 fragColor;
void main()
{
fragColor = vColor;
}

View File

@ -1,12 +0,0 @@
// Vertex shader.
#version 410
in vec4 aPosition;
uniform vec4 color;
out vec4 vColor;
void main()
{
gl_Position = aPosition;
vColor = color;
}

View File

@ -1,14 +0,0 @@
// Fragment shader.
#version 410
uniform sampler2D gm_BaseTexture;
in vec4 vColor;
in vec2 vTexCoord;
out vec4 fragColor;
void main() {
vec4 c = vColor * texture(gm_BaseTexture, vTexCoord);
fragColor = c;
}

View File

@ -1,10 +0,0 @@
// https://github.com/Rinnegatamante/vitaQuake/blob/master/shaders/rgba_f.cg
#version 410
in vec4 vColor;
out vec4 fragColor;
void main()
{
fragColor = vColor;
}

View File

@ -1,13 +0,0 @@
// https://github.com/Rinnegatamante/vitaQuake/blob/master/shaders/replace_alpha_f.cg
#version 410
uniform sampler2D tex;
in vec2 vTexcoord;
out vec4 fragColor;
void main()
{
vec4 c = texture(tex, vTexcoord);
if (c.a > 0.666) fragColor = c;
else discard;
}

View File

@ -1,13 +0,0 @@
// Fragment shader.
#version 410
uniform vec4 uTintColor;
uniform sampler2D tex;
in vec2 vTexcoord;
out vec4 fragColor;
void main() {
fragColor = texture(tex, vTexcoord) * uTintColor;
}

View File

@ -1,15 +0,0 @@
// https://github.com/Rinnegatamante/vitaQuake/blob/master/shaders/texture2d_v.cg
#version 410
uniform mat4 wvp;
in vec3 position;
in vec2 texcoord;
out vec2 vTexcoord;
void main()
{
gl_Position = vec4(position, 1) * wvp;
vTexcoord = texcoord;
}

View File

@ -1,19 +0,0 @@
// Vertex shader.
#version 410
in vec4 inputaPosition;
in vec4 inputaColour;
in vec2 inputaTexCoord;
uniform mat4 gm_Matrices[5];
out vec4 vColor;
out vec2 vTexCoord;
void main()
{
gl_Position = gm_Matrices[4] * inputaPosition;
vColor = inputaColour;
vTexCoord = inputaTexCoord;
}

View File

@ -1,8 +0,0 @@
// Vertex shader.
#version 410
in vec2 aPosition;
void main() {
gl_Position = vec4(aPosition, 1, 1);
}

View File

@ -1,20 +0,0 @@
// https://github.com/Rinnegatamante/vitaQuake/blob/master/shaders/texture2d_fog_v.cg
#version 410
uniform mat4 wvp;
in vec3 position;
in vec2 texcoord;
out vec4 vColor;
out float vFog;
out vec2 vTexcoord;
void main()
{
gl_Position = vec4(position, 1) * wvp;
float dist = distance(gl_Position,vec4(0.0,0.0,0.0,1.0));
vFog = ((512.0 - dist) / (512.0));
vTexcoord = texcoord;
}

View File

@ -1,16 +0,0 @@
// https://github.com/Rinnegatamante/vitaQuake/blob/master/shaders/modulate_rgba_alpha_fog_f.cg
#version 410
uniform sampler2D tex;
in vec4 vColor;
in vec2 vTexcoord;
in float vFog;
out vec4 fragColor;
void main()
{
vec4 c = texture(tex, vTexcoord) * vColor;
c.rgb = c.rgb * vFog;
if (c.a > 0.666) fragColor = c;
else discard;
}

View File

@ -1,15 +0,0 @@
// https://github.com/Rinnegatamante/vitaQuake/blob/master/shaders/modulate_fog_f.cg
#version 410
uniform sampler2D tex;
uniform vec4 vColor;
in vec2 vTexcoord;
in float vFog;
out vec4 fragColor;
void main()
{
vec4 c = texture(tex, vTexcoord) * vColor;
c.rgb = c.rgb * vFog;
fragColor = c;
}

View File

@ -1,12 +0,0 @@
// https://github.com/Rinnegatamante/vitaQuake/blob/master/shaders/modulate_f.cg
#version 410
uniform sampler2D tex;
uniform vec4 vColor;
in vec2 vTexcoord;
out vec4 fragColor;
void main()
{
fragColor = texture(tex, vTexcoord) * vColor;
}

View File

@ -1,17 +0,0 @@
// Fragment shader.
#version 410
uniform float textureEnable;
uniform sampler2D tex;
in vec2 vTexcoord;
in vec4 vColor;
out vec4 fragColor;
void main() {
if (textureEnable > 0.5f) {
fragColor = vColor * texture(tex, vTexcoord);
} else {
fragColor = vColor;
}
}

View File

@ -1,11 +0,0 @@
// Fragment shader.
#version 410
in vec4 vColor;
out vec4 fragColor;
void main()
{
fragColor = vColor;
}

View File

@ -1,36 +0,0 @@
// Vertex shader.
#version 410
in vec2 aPosition;
in vec2 aTexcoord;
in vec4 aColor;
in float aAngle;
in vec2 aTranslation;
uniform mat4 pm;
uniform float trsEnable;
out vec4 vColor;
out vec2 vTexcoord;
void main() {
if (trsEnable > 0.5f){
mat3 rotate_mat = mat3
(cos(aAngle), sin(aAngle), 0.0f,
-sin(aAngle), cos(aAngle), 0.0f,
0.0f, 0.0f, 1.0f);
mat4 translate_mat = mat4
(1.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f,
0.0f, 0.0f, 1.0f, 0.0f,
aTranslation.x, aTranslation.y, 0.0f, 1.0f);
vec3 xformed = vec3(aPosition, 0.0f) * rotate_mat;
gl_Position = (pm * translate_mat) * vec4(xformed, 1.0f);
}else{
gl_Position = pm * vec4(aPosition, 0.0f, 1.0f);
}
vColor = aColor;
vTexcoord = aTexcoord;
}

View File

@ -1,14 +0,0 @@
// https://github.com/Rinnegatamante/vitaQuake/blob/master/shaders/modulate_rgba_alpha_f.cg
#version 410
uniform sampler2D tex;
in vec4 vColor;
in vec2 vTexcoord;
out vec4 fragColor;
void main()
{
vec4 c = texture(tex, vTexcoord) * vColor;
if (c.a > 0.666) fragColor = c;
else discard;
}

View File

@ -1,10 +0,0 @@
// Fragment shader.
#version 410
in vec4 vColor;
out vec4 fragColor;
void main() {
fragColor = vColor;
}

View File

@ -1,12 +0,0 @@
// https://github.com/Rinnegatamante/vitaQuake/blob/master/shaders/modulate_rgba_f.cg
#version 410
uniform sampler2D tex;
in vec4 vColor;
in vec2 vTexcoord;
out vec4 fragColor;
void main()
{
fragColor = texture(tex, vTexcoord) * vColor;
}

View File

@ -1,10 +0,0 @@
// Fragment shader.
#version 410
uniform vec4 uClearColor;
out vec4 fragColor;
void main() {
fragColor = uClearColor;
}

View File

@ -1,10 +0,0 @@
// https://github.com/xerpi/libvita2d/blob/master/libvita2d/shader/color_f.cg
#version 410
in vec4 vColor;
out vec4 fragColor;
void main()
{
fragColor = vColor;
}

View File

@ -1,14 +0,0 @@
// https://github.com/xerpi/libvita2d/blob/master/libvita2d/shader/color_v.cg
#version 410
uniform mat4 wvp;
in vec3 aPosition;
in vec4 aColor;
out vec4 vColor;
void main()
{
gl_Position = wvp * vec4(aPosition, 1);
vColor = aColor;
}

View File

@ -1,13 +0,0 @@
// Vertex shader.
#version 410
in vec4 aPosition;
uniform vec4 color;
out vec4 vColor;
void main()
{
gl_Position = aPosition;
vColor = color;
}

View File

@ -1,18 +0,0 @@
// https://github.com/Rinnegatamante/vitaQuake/blob/master/shaders/texture2d_rgba_v.cg
#version 410
uniform mat4 wvp;
in vec3 position;
in vec2 texcoord;
in vex4 color;
out vec4 vColor;
out vec2 vTexcoord;
void main()
{
gl_Position = vec4(position, 1) * wvp;
vTexcoord = texcoord;
vColor = color;
}

View File

@ -1,9 +0,0 @@
// https://github.com/xerpi/libvita2d/blob/master/libvita2d/shader/clear_v.cg
#version 410
in vec2 aPosition;
void main()
{
gl_Position = vec4(aPosition, 1, 1);
}

View File

@ -1,16 +0,0 @@
// https://github.com/Rinnegatamante/vitaQuake/blob/master/shaders/modulate_alpha_fog_f.cg
#version 410
uniform sampler2D tex;
uniform vec4 vColor;
in vec2 vTexcoord;
in float vFog;
out vec4 fragColor;
void main()
{
vec4 c = texture(tex, vTexcoord) * vColor;
c.rgb = c.rgb * vFog;
if (c.a > 0.666) fragColor = c;
else discard;
}

View File

@ -1,22 +0,0 @@
// https://github.com/Rinnegatamante/vitaQuake/blob/master/shaders/texture2d_rgba_fog_v.cg
#version 410
uniform mat4 wvp;
in vec3 position;
in vec2 texcoord;
in vex4 color;
out vec4 vColor;
out float vFog;
out vec2 vTexcoord;
void main()
{
gl_Position = vec4(position, 1) * wvp;
float dist = distance(gl_Position,vec4(0.0,0.0,0.0,1.0));
vFog = ((512.0 - dist) / (512.0));
vTexcoord = texcoord;
vColor = color;
}

View File

@ -1,14 +0,0 @@
// https://github.com/Rinnegatamante/vitaQuake/blob/master/shaders/modulate_alpha_f.cg
#version 410
uniform sampler2D tex;
uniform vec4 vColor;
in vec2 vTexcoord;
out vec4 fragColor;
void main()
{
vec4 c = texture(tex, vTexcoord) * vColor;
if (c.a > 0.666) fragColor = c;
else discard;
}

View File

@ -1,14 +0,0 @@
// Vertex shader.
#version 410
in vec4 input_in_Position;
in vec2 input_in_TextureCoord;
out vec2 vTexcoord;
uniform mat4 _gm_Matrices[5];
void main() {
vec4 _object_space_pos = vec4(input_in_Position.x, input_in_Position.y, input_in_Position.z, 1.0);
gl_Position = _gm_Matrices[4] * _object_space_pos;
vTexcoord = input_in_TextureCoord;
}

View File

@ -1,15 +0,0 @@
// Fragment shader.
#version 410
uniform sampler2D gm_BaseTexture;
in vec4 vColor;
in vec2 vTexCoord;
out vec4 fragColor;
void main()
{
vec4 c = vColor * texture(gm_BaseTexture, vTexCoord);
fragColor = c;
}

View File

@ -1,10 +0,0 @@
// https://github.com/xerpi/libvita2d/blob/master/libvita2d/shader/clear_f.cg
#version 410
uniform vec4 uClearColor;
out vec4 fragColor;
void main()
{
fragColor = uClearColor;
}

View File

@ -1,14 +0,0 @@
// Fragment shader.
#version 410
uniform mat4 _u_colourArray;
uniform sampler2D _gm_BaseTexture;
in vec2 vTexcoord;
out vec4 fragColor;
void main() {
vec4 c = _u_colourArray * texture(_gm_BaseTexture, vTexcoord);
fragColor = c;
}

View File

@ -1,14 +0,0 @@
// https://github.com/Rinnegatamante/vitaQuake/blob/master/shaders/rgba_v.cg
#version 410
uniform mat4 wvp;
in vec3 aPosition;
in vec4 aColor;
out vec4 vColor;
void main()
{
gl_Position = vec4(aPosition, 1) * wvp;
vColor = aColor;
}

View File

@ -1,10 +0,0 @@
// https://github.com/Rinnegatamante/vitaQuake/blob/master/shaders/vertex_f.cg
#version 410
uniform vec4 color;
out vec4 fragColor;
void main()
{
fragColor = color;
}

View File

@ -1,12 +0,0 @@
// https://github.com/xerpi/libvita2d/blob/master/libvita2d/shader/texture_tint_f.cg
#version 410
uniform sampler2D tex;
uniform vec4 uTintColor;
in vec2 vTexcoord;
out vec4 fragColor;
void main()
{
fragColor = texture(tex, vTexcoord) * uTintColor;
}

View File

@ -1,14 +0,0 @@
// https://github.com/xerpi/libvita2d/blob/master/libvita2d/shader/texture_v.cg
#version 410
uniform mat4 wvp;
in vec3 aPosition;
in vec2 aTexcoord;
out vec2 vTexcoord;
void main()
{
gl_Position = wvp * vec4(aPosition, 1);
vTexcoord = aTexcoord;
}

View File

@ -1,14 +0,0 @@
// https://github.com/Rinnegatamante/vitaQuake/blob/master/shaders/replace_alpha_fog_f.cg
#version 410
uniform sampler2D tex;
in vec2 vTexcoord;
in float vFog;
void main()
{
vec4 c = texture(tex, vTexcoord);
c.rgb = c.rgb * vFog;
if (c.a > 0.666) fragColor = c;
else discard;
}

View File

@ -1,14 +0,0 @@
// Vertex shader.
#version 410
in vec3 aPosition;
in vec4 aColor;
uniform mat4 wvp;
out vec4 vColor;
void main() {
gl_Position = wvp * vec4(aPosition, 1);
vColor = aColor;
}

View File

@ -1,14 +0,0 @@
// https://github.com/Rinnegatamante/vitaQuake/blob/master/shaders/replace_fog_f.cg
#version 410
uniform sampler2D tex;
in vec2 vTexcoord;
in float vFog;
out vec4 fragColor;
void main()
{
vec4 c = texture(tex, vTexcoord);
c.rgb = c.rgb * vFog;
fragColor = c;
}

View File

@ -1,11 +0,0 @@
// https://github.com/Rinnegatamante/vitaQuake/blob/master/shaders/replace_f.cg
#version 410
uniform sampler2D tex;
in vec2 vTexcoord;
out vec4 fragColor;
void main()
{
fragColor = texture(tex, vTexcoord);
}

View File

@ -1,10 +0,0 @@
// https://github.com/Rinnegatamante/vitaQuake/blob/master/shaders/vertex_v.cg
#version 410
uniform mat4 wvp;
in vec3 aPosition;
void main()
{
gl_Position = vec4(aPosition, 1) * wvp;
}

View File

@ -1,14 +0,0 @@
// Vertex shader.
#version 410
in vec3 aPosition;
in vec2 aTexcoord;
uniform mat4 wvp;
out vec2 vTexcoord;
void main() {
gl_Position = wvp * vec4(aPosition, 1);
vTexcoord = aTexcoord;
}

View File

@ -1,12 +0,0 @@
// Fragment shader.
#version 410
uniform sampler2D tex;
in vec2 vTexcoord;
out vec4 fragColor;
void main() {
gl_FragColor = texture(tex, vTexcoord);
}

View File

@ -1,11 +0,0 @@
// https://github.com/xerpi/libvita2d/blob/master/libvita2d/shader/texture_f.cg
#version 410
uniform sampler2D tex;
in vec2 vTexcoord;
out vec4 fragColor;
void main()
{
fragColor = texture(tex, vTexcoord);
}