Initial Commit

This commit is contained in:
2026-02-12 11:46:06 +03:00
commit b044c8d1a5
3973 changed files with 1599881 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
#version 120
varying vec3 v_color;
void main()
{
gl_FragColor = vec4(v_color, 1.0);
}

View File

@@ -0,0 +1,15 @@
#version 120
attribute vec3 a_position;
attribute vec3 a_color;
varying vec3 v_color;
uniform mat4 u_modelViewProjection;
void main()
{
gl_Position = u_modelViewProjection * vec4(a_position, 1.0f);
v_color = a_color;
}

View File

@@ -0,0 +1,17 @@
#version 120
varying vec3 v_position;
varying vec3 v_normal;
varying vec2 v_texcoord;
varying vec3 v_finalColor;
uniform sampler2D u_albedoTexture;
uniform vec4 u_customColor;
void main() {
//gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
//gl_FragColor = u_customColor * vec4(v_finalColor, 1.0) * texture2D(u_albedoTexture, v_texcoord);
gl_FragColor = vec4(v_finalColor, 1.0) * texture2D(u_albedoTexture, v_texcoord);
//gl_FragColor = vec4( v_normal, 1.0 );
//gl_FragColor = texture2D(u_albedoTexture, v_texcoord);
}

View File

@@ -0,0 +1,46 @@
#version 120
attribute vec3 a_position;
attribute vec3 a_normal;
attribute vec2 a_texcoord;
varying vec3 v_position;
varying vec3 v_normal;
varying vec2 v_texcoord;
varying vec3 v_finalColor;
uniform mat4 u_modelMatrix;
uniform mat4 u_viewMatrix;
uniform mat4 u_projectionMatrix;
uniform mat4 u_modelViewProjection;
vec3 CalcOmniLight()
{
vec3 lightPos = vec3(0.1, 2.1, 0.1);
float d = distance(lightPos, v_position);
vec3 L = normalize(lightPos-v_position);
vec3 N = normalize(v_normal);
vec3 col = vec3( max(0, dot(N, L) / d) );
col = col * 0.8 + 0.2;
return col;
}
vec3 CalcDirLight()
{
vec3 lightPos = vec3(5.0, 10.0, 1.0);
//lightPos = -lightPos;
vec3 L = normalize(lightPos);
vec3 N = normalize(v_normal);
vec3 col = vec3( max(0, dot(N, L)) );
col = col * 0.8 + 0.2;
return col;
}
void main() {
v_position = vec3( u_modelMatrix * vec4(a_position, 1.0) );
v_normal = vec3( mat3(u_modelMatrix) * a_normal );
v_texcoord = a_texcoord;
v_finalColor = CalcDirLight();
gl_Position = u_modelViewProjection * vec4(a_position, 1);
}

7
data/shaders/test.ps Normal file
View File

@@ -0,0 +1,7 @@
#version 130
varying vec4 v_color;
void main() {
gl_FragColor = v_color;
}

11
data/shaders/test.vs Normal file
View File

@@ -0,0 +1,11 @@
#version 130
attribute vec2 a_position;
attribute vec4 a_color;
varying vec4 v_color;
void main() {
v_color = a_color;
gl_Position = vec4(a_position.xy,0,1);
}

10
data/shaders/ui_base.ps Normal file
View File

@@ -0,0 +1,10 @@
#version 120
uniform sampler2D u_albedoTexture;
varying vec2 v_texcoord;
varying vec4 v_color;
void main() {
gl_FragColor = v_color * texture2D(u_albedoTexture, v_texcoord.st);
}

16
data/shaders/ui_base.vs Normal file
View File

@@ -0,0 +1,16 @@
#version 120
uniform mat4 u_projectionMatrix;
attribute vec2 a_position;
attribute vec2 a_texcoord;
attribute vec4 a_color;
varying vec2 v_texcoord;
varying vec4 v_color;
void main() {
v_texcoord = a_texcoord;
v_color = a_color;
gl_Position = u_projectionMatrix * vec4(a_position.xy, 0, 1);
}