core 0.1-beta

This commit is contained in:
Fokinator
2026-05-27 22:02:28 +03:00
parent 38c599c2cf
commit e788a99545
224 changed files with 7812 additions and 3946 deletions
+28 -9
View File
@@ -1,20 +1,39 @@
#version 330 core
layout (location = 0) in vec2 a_Position;
layout (location = 0) in vec3 a_Position;
layout (location = 1) in vec2 a_TexCoord;
out vec2 v_TexCoord;
uniform mat4 u_ModelViewProj;
uniform mat4 u_Proj;
uniform mat4 u_Model;
uniform sampler2D u_Texture;
uniform float u_Mosaic;
uniform float u_Pixelation;
uniform float u_Bulge; // Radial distortion strength
uniform float u_Whirl; // Rotation angle based on distance from center
uniform float u_SkewX;
uniform float u_SkewY;
void main() {
// Apply skew
vec2 skewedPos = a_Position;
skewedPos.x += a_Position.y * u_SkewX * 0.01; // Shear X based on Y
skewedPos.y += a_Position.x * u_SkewY * 0.01; // Shear Y based on X
// {{apply_bulge}}
// {{apply_whirl}}
// {{apply_mosaic}}
// {{apply_pixelation}}
gl_Position = u_ModelViewProj * vec4(skewedPos, 0.0, 1.0);
v_TexCoord = a_TexCoord;
void main() {
vec4 pos = u_Proj * u_Model * vec4(a_Position, 1.0);
// Apply skew
pos.x += pos.y * u_SkewX * 0.01; // Shear X based on Y
pos.y += pos.x * u_SkewY * 0.01; // Shear Y based on X
gl_Position = pos;
vec2 uv = a_TexCoord;
uv = applyMosaic(uv, u_Mosaic);
uv = applyPixelation(uv, u_Pixelation, u_Texture);
uv = applyWhirl(uv, u_Whirl);
uv = applyBulge(uv, u_Bulge);
v_TexCoord = uv;
}