Editor camera zoom and pan; fix mouse input signals; tex editor to own file; fix grid drawing

This commit is contained in:
2023-09-12 22:19:46 +00:00
parent ef95b233e2
commit e6ef147c40
14 changed files with 679 additions and 681 deletions

View File

@@ -5,7 +5,26 @@ out vec4 frag_color;
uniform sampler2D diffuse_texture;
float[] kernel = float[9](1.0/9.0,1.0/9.0,1.0/9.0,
1.0/9.0,1.0/9.0,1.0/9.0,
1.0/9.0,1.0/9.0,1.0/9.0);
void main()
{
frag_color = texture(diffuse_texture, TexCoords);
return;
vec2 res = vec2(640,360);
vec2 uv = gl_FragCoord.xy;
vec2 screen = textureSize(diffuse_texture,0);
vec3 acc = vec3(0);
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
vec2 realRes = uv + vec2(i-1,j-1);
acc += texture(diffuse_texture, realRes / res).rgb * kernel[i*3+j];
}
}
// frag_color = vec4(acc,1);
}

View File

@@ -12,11 +12,7 @@ uniform vec2 dimen;
void main()
{
// vec4 ipos = inverse(projection) * vec4(pos, 0.f, 1.f);
apos = pos * dimen;
// apos += offset;
// apos = pos + offset;
apos = ((pos*0.5)*dimen) + offset;
gl_Position = vec4(pos, 0.f, 1.f);
}