This commit is contained in:
2023-06-28 16:35:41 +00:00
parent e549a9445b
commit c81c0f22f2
15 changed files with 197 additions and 48 deletions

View File

@@ -2,12 +2,12 @@
in vec2 uv; /* image uv */
in vec4 border; /* uv length of border, normalized to image dimensions; left, bottom, right, top */
in vec2 scale; /* polygon dimensions / texture dimensions */
in vec2 scale; /* polygon dimensions ~ texture dimensions */
in vec4 fcolor;
out vec4 color;
uniform sampler2d image;
uniform sampler2D image;
float map(float value, float min1, float max1, float min2, float max2)
{
@@ -24,7 +24,7 @@ float processAxis(float coord, float texBorder, float winBorder)
return map(coord, 1 - winBorder, 1, 1 - texBorder, 1);
}
uv9slice(vec2 uv, vec2 s, vec4 b)
vec2 uv9slice(vec2 uv, vec2 s, vec4 b)
{
vec2 t = clamp((s * uv - b.xy) / (s - b.xy - b.zw), 0.0, 1.0);
return mix(uv * s, 1.0 - s * (1.0 - uv), t);

View File

@@ -1,5 +1,7 @@
#version 330 core
layout (location = 0) in vec2 vert;
layout (location = 1) in vec2 vuv;
layout (location = 2) in vec4 vborder;