This commit is contained in:
2025-04-29 13:39:02 -05:00
commit 9cbb583982
2257 changed files with 77258 additions and 0 deletions

View File

@@ -0,0 +1,85 @@
{
"version" : 1,
"replacementkey" : "localcontrast",
"name" : "ui_editor_effect_local_contrast_title",
"description" : "ui_editor_effect_local_contrast_description",
"group" : "enhance",
"performance" : "expensive",
"preview" : "preview/project.json",
"passes" :
[
{
"material" : "materials/effects/localcontrast_downsample4.json",
"target" : "_rt_QuarterCompoBuffer1",
"bind" :
[
{
"name" : "previous",
"index" : 0
}
]
},
{
"material" : "materials/effects/localcontrast_gaussian_x.json",
"target" : "_rt_QuarterCompoBuffer2",
"bind" :
[
{
"name" : "_rt_QuarterCompoBuffer1",
"index" : 0
}
]
},
{
"material" : "materials/effects/localcontrast_gaussian_y.json",
"target" : "_rt_QuarterCompoBuffer1",
"bind" :
[
{
"name" : "_rt_QuarterCompoBuffer2",
"index" : 0
}
]
},
{
"material" : "materials/effects/localcontrast_combine.json",
"bind" :
[
{
"name" : "_rt_QuarterCompoBuffer1",
"index" : 0
},
{
"name" : "previous",
"index" : 2
}
]
}
],
"fbos" :
[
{
"name" : "_rt_QuarterCompoBuffer1",
"scale" : 4,
"format" : "rgba8888"
},
{
"name" : "_rt_QuarterCompoBuffer2",
"scale" : 4,
"format" : "rgba8888"
}
],
"dependencies" :
[
"materials/effects/localcontrast_downsample4.json",
"materials/effects/localcontrast_gaussian_x.json",
"materials/effects/localcontrast_gaussian_y.json",
"materials/effects/localcontrast_combine.json",
"shaders/effects/localcontrast_downsample4.frag",
"shaders/effects/localcontrast_downsample4.vert",
"shaders/effects/localcontrast_gaussian.frag",
"shaders/effects/localcontrast_gaussian.vert",
"shaders/effects/localcontrast_combine.frag",
"shaders/effects/localcontrast_combine.vert"
]
}

View File

@@ -0,0 +1,9 @@
{
"passes": [{
"shader": "effects/localcontrast_combine",
"blending": "normal",
"depthtest": "disabled",
"depthwrite": "disabled",
"cullmode": "nocull"
}]
}

View File

@@ -0,0 +1,9 @@
{
"passes": [{
"shader": "effects/localcontrast_downsample4",
"blending": "normal",
"depthtest": "disabled",
"depthwrite": "disabled",
"cullmode": "nocull"
}]
}

View File

@@ -0,0 +1,9 @@
{
"passes": [{
"shader": "effects/localcontrast_gaussian",
"blending": "normal",
"depthtest": "disabled",
"depthwrite": "disabled",
"cullmode": "nocull"
}]
}

View File

@@ -0,0 +1,12 @@
{
"passes": [{
"shader": "effects/localcontrast_gaussian",
"blending": "normal",
"depthtest": "disabled",
"depthwrite": "disabled",
"cullmode": "nocull",
"combos": {
"VERTICAL" : 1
}
}]
}

View File

@@ -0,0 +1,82 @@
{
"name" : "Local Contrast",
"description" : "Apply a local contrast enhancement to the image.",
"group" : "composite",
//"preview" : "preview/project.json",
"passes" :
[
{
"material" : "materials/effects/localcontrast_downsample4.json",
"target" : "_rt_QuarterCompoBuffer1",
"bind" :
[
{
"name" : "previous",
"index" : 0
}
]
},
{
"material" : "materials/effects/localcontrast_gaussian_x.json",
"target" : "_rt_QuarterCompoBuffer2",
"bind" :
[
{
"name" : "_rt_QuarterCompoBuffer1",
"index" : 0
}
]
},
{
"material" : "materials/effects/localcontrast_gaussian_y.json",
"target" : "_rt_QuarterCompoBuffer1",
"bind" :
[
{
"name" : "_rt_QuarterCompoBuffer2",
"index" : 0
}
]
},
{
"material" : "materials/effects/localcontrast_combine.json",
"bind" :
[
{
"name" : "_rt_QuarterCompoBuffer1",
"index" : 0
},
{
"name" : "previous",
"index" : 2
}
]
}
],
"fbos" :
[
{
"name" : "_rt_QuarterCompoBuffer1",
"scale" : 4,
"format" : "rgba8888"
},
{
"name" : "_rt_QuarterCompoBuffer2",
"scale" : 4,
"format" : "rgba8888"
}
],
"dependencies" :
[
"materials/effects/localcontrast_downsample4.json",
"materials/effects/localcontrast_gaussian_x.json",
"materials/effects/localcontrast_gaussian_y.json",
"materials/effects/localcontrast_combine.json",
"shaders/effects/localcontrast_downsample4.frag",
"shaders/effects/localcontrast_downsample4.vert",
"shaders/effects/localcontrast_gaussian.frag",
"shaders/effects/localcontrast_gaussian.vert",
"shaders/effects/localcontrast_combine.frag",
"shaders/effects/localcontrast_combine.vert"
]
}

View File

@@ -0,0 +1,13 @@
{
"passes" :
[
{
"blending" : "translucent",
"cullmode" : "nocull",
"depthtest" : "disabled",
"depthwrite" : "disabled",
"shader" : "genericimage2",
"textures" : [ "effectpreview" ]
}
]
}

View File

@@ -0,0 +1,6 @@
{
"clampuvs" : true,
"format" : "rgba8888",
"nomip" : true,
"nonpoweroftwo" : true
}

View File

@@ -0,0 +1,9 @@
{
"passes": [{
"shader": "effects/localcontrast_combine",
"blending": "normal",
"depthtest": "disabled",
"depthwrite": "disabled",
"cullmode": "nocull"
}]
}

View File

@@ -0,0 +1,9 @@
{
"passes": [{
"shader": "effects/localcontrast_downsample4",
"blending": "normal",
"depthtest": "disabled",
"depthwrite": "disabled",
"cullmode": "nocull"
}]
}

View File

@@ -0,0 +1,9 @@
{
"passes": [{
"shader": "effects/localcontrast_gaussian",
"blending": "normal",
"depthtest": "disabled",
"depthwrite": "disabled",
"cullmode": "nocull"
}]
}

View File

@@ -0,0 +1,12 @@
{
"passes": [{
"shader": "effects/localcontrast_gaussian",
"blending": "normal",
"depthtest": "disabled",
"depthwrite": "disabled",
"cullmode": "nocull",
"combos": {
"VERTICAL" : 1
}
}]
}

View File

@@ -0,0 +1,4 @@
{
"autosize" : true,
"material" : "materials/effectpreview.json"
}

View File

@@ -0,0 +1,18 @@
{
"file" : "scene.json",
"general" :
{
"properties" :
{
"schemecolor" :
{
"order" : 0,
"text" : "ui_browse_properties_scheme_color",
"type" : "color",
"value" : "0 0 0"
}
}
},
"title" : "preview",
"type" : "scene"
}

View File

@@ -0,0 +1,104 @@
{
"camera" :
{
"center" : "0.000 0.000 -1.000",
"eye" : "0.000 0.000 0.000",
"up" : "0.000 1.000 0.000"
},
"general" :
{
"ambientcolor" : "0.3 0.3 0.3",
"bloom" : false,
"bloomstrength" : 2,
"bloomthreshold" : 0.64999997615814209,
"cameraparallax" : false,
"cameraparallaxamount" : 0.5,
"cameraparallaxdelay" : 0.10000000149011612,
"cameraparallaxmouseinfluence" : 0,
"camerapreview" : true,
"camerashake" : false,
"camerashakeamplitude" : 0.5,
"camerashakeroughness" : 1,
"camerashakespeed" : 3,
"clearcolor" : "0.7 0.7 0.7",
"orthogonalprojection" :
{
"height" : 256,
"width" : 256
},
"skylightcolor" : "0.3 0.3 0.3"
},
"objects" :
[
{
"angles" : "0.000 0.000 0.000",
"colorBlendMode" : 0,
"copybackground" : true,
"depth" : 1,
"id" : 38,
"image" : "models/effectpreview.json",
"name" : "",
"origin" : "128.000 128.000 0.000",
"parallaxDepth" : "1.000 1.000",
"scale" : "1.000 1.000 1.000",
"size" : "256.000 256.000",
"visible" : true
},
{
"angles" : "0.000 0.000 0.000",
"colorBlendMode" : 0,
"copybackground" : true,
"dependencies" : [ 33 ],
"effects" :
[
{
"file" : "effects/localcontrast/effect.json",
"passes" :
[
{},
{
"combos" :
{
"KERNEL" : 1
},
"constantshadervalues" :
{
"Scale" : "0.76 0.76"
}
},
{
"combos" :
{
"KERNEL" : 1,
"VERTICAL" : 1
},
"constantshadervalues" :
{
"Scale" : "0.76 0.76"
}
},
{
"combos" :
{
"GREYSCALE" : 0
},
"constantshadervalues" :
{
"Strength" : 1.0700000524520874
},
"textures" : [ null, "util/white", "_rt_imageLayerComposite_33_a" ]
}
]
}
],
"id" : 33,
"image" : "models/util/fullscreenlayer.json",
"name" : "Fullscreen",
"origin" : "0.000 0.000 0.000",
"parallaxDepth" : "1.000 1.000",
"scale" : "1.000 1.000 1.000",
"size" : "714.000 521.000",
"visible" : true
}
]
}

View File

@@ -0,0 +1,26 @@
// [COMBO] {"material":"Greyscale","combo":"GREYSCALE","type":"options","default":0}
varying vec4 v_TexCoord;
uniform sampler2D g_Texture0; // {"material":"Framebuffer","hidden":true}
uniform sampler2D g_Texture1; // {"material":"Mask","mode":"opacitymask","default":"util/white"}
uniform sampler2D g_Texture2; // {"material":"Prev","hidden":true}
uniform float g_Amount; // {"material":"Strength","default":1.0,"range":[0.01, 5]}
void main() {
vec4 blurred = texSample2D(g_Texture0, v_TexCoord.xy);
vec4 albedo = texSample2D(g_Texture2, v_TexCoord.xy);
vec3 delta = albedo.rgb - blurred.rgb;
#if GREYSCALE == 1
delta = CAST3(dot(vec3(0.11, 0.59, 0.3), delta));
#endif
vec3 enhanced = albedo.rgb + delta * g_Amount;
float mask = texSample2D(g_Texture1, v_TexCoord.zw).r;
albedo.rgb = mix(albedo.rgb, enhanced.rgb, mask);
gl_FragColor = albedo;
}

View File

@@ -0,0 +1,16 @@
uniform mat4 g_ModelViewProjectionMatrix;
uniform vec4 g_Texture1Resolution;
attribute vec3 a_Position;
attribute vec2 a_TexCoord;
varying vec4 v_TexCoord;
void main() {
gl_Position = mul(vec4(a_Position, 1.0), g_ModelViewProjectionMatrix);
v_TexCoord.xy = a_TexCoord;
v_TexCoord.zw = vec2(v_TexCoord.x * g_Texture1Resolution.z / g_Texture1Resolution.x,
v_TexCoord.y * g_Texture1Resolution.w / g_Texture1Resolution.y);
}

View File

@@ -0,0 +1,12 @@
varying vec4 v_TexCoord01;
varying vec4 v_TexCoord23;
uniform sampler2D g_Texture0; // {"material":"Framebuffer","hidden":true}
void main() {
gl_FragColor = (texSample2D(g_Texture0, v_TexCoord01.xy) +
texSample2D(g_Texture0, v_TexCoord01.zw) +
texSample2D(g_Texture0, v_TexCoord23.xy) +
texSample2D(g_Texture0, v_TexCoord23.zw)) * 0.25;
}

View File

@@ -0,0 +1,18 @@
attribute vec3 a_Position;
attribute vec2 a_TexCoord;
varying vec4 v_TexCoord01;
varying vec4 v_TexCoord23;
uniform vec4 g_Texture0Resolution;
void main() {
gl_Position = vec4(a_Position, 1.0);
vec2 offsets = 1.0 / g_Texture0Resolution.zw;
v_TexCoord01.xy = a_TexCoord - offsets;
v_TexCoord01.zw = a_TexCoord + vec2(offsets.x, -offsets.y);
v_TexCoord23.xy = a_TexCoord + vec2(-offsets.x, offsets.y);
v_TexCoord23.zw = a_TexCoord + offsets;
}

View File

@@ -0,0 +1,46 @@
#if KERNEL == 0
varying vec2 v_TexCoord[13];
#endif
#if KERNEL == 1
varying vec2 v_TexCoord[7];
#endif
#if KERNEL == 2
varying vec2 v_TexCoord[3];
#endif
uniform sampler2D g_Texture0; // {"material":"Framebuffer","hidden":true}
void main() {
#if KERNEL == 0
vec4 albedo = texSample2D(g_Texture0, v_TexCoord[0]) * 0.006299 +
texSample2D(g_Texture0, v_TexCoord[1]) * 0.017298 +
texSample2D(g_Texture0, v_TexCoord[2]) * 0.039533 +
texSample2D(g_Texture0, v_TexCoord[3]) * 0.075189 +
texSample2D(g_Texture0, v_TexCoord[4]) * 0.119007 +
texSample2D(g_Texture0, v_TexCoord[5]) * 0.156756 +
texSample2D(g_Texture0, v_TexCoord[6]) * 0.171834 +
texSample2D(g_Texture0, v_TexCoord[7]) * 0.156756 +
texSample2D(g_Texture0, v_TexCoord[8]) * 0.119007 +
texSample2D(g_Texture0, v_TexCoord[9]) * 0.075189 +
texSample2D(g_Texture0, v_TexCoord[10]) * 0.039533 +
texSample2D(g_Texture0, v_TexCoord[11]) * 0.017298 +
texSample2D(g_Texture0, v_TexCoord[12]) * 0.006299;
#endif
#if KERNEL == 1
vec4 albedo = texSample2D(g_Texture0, v_TexCoord[0]) * 0.071303 +
texSample2D(g_Texture0, v_TexCoord[1]) * 0.131514 +
texSample2D(g_Texture0, v_TexCoord[2]) * 0.189879 +
texSample2D(g_Texture0, v_TexCoord[3]) * 0.214607 +
texSample2D(g_Texture0, v_TexCoord[4]) * 0.189879 +
texSample2D(g_Texture0, v_TexCoord[5]) * 0.131514 +
texSample2D(g_Texture0, v_TexCoord[6]) * 0.071303;
#endif
#if KERNEL == 2
vec4 albedo = texSample2D(g_Texture0, v_TexCoord[0]) * 0.25 +
texSample2D(g_Texture0, v_TexCoord[1]) * 0.5 +
texSample2D(g_Texture0, v_TexCoord[2]) * 0.25;
#endif
gl_FragColor = albedo;
}

View File

@@ -0,0 +1,61 @@
// [COMBO] {"material":"Kernel size","combo":"KERNEL","type":"options","default":0,"options":{"13x13":0,"7x7":1,"3x3":2}}
uniform vec2 g_Scale; // {"material":"Scale","default":"1 1","linked":true,"range":[0.01, 2.0]}
attribute vec3 a_Position;
attribute vec2 a_TexCoord;
#if KERNEL == 0
varying vec2 v_TexCoord[13];
#endif
#if KERNEL == 1
varying vec2 v_TexCoord[7];
#endif
#if KERNEL == 2
varying vec2 v_TexCoord[3];
#endif
uniform vec4 g_Texture0Resolution;
void main() {
gl_Position = vec4(a_Position, 1.0);
#if VERTICAL
float offsetX = 0.0f;
float offsetY = g_Scale.y / g_Texture0Resolution.w;
#else
float offsetX = g_Scale.x / g_Texture0Resolution.z;
float offsetY = 0.0f;
#endif
#if KERNEL == 0
v_TexCoord[0] = vec2(a_TexCoord.x - offsetX * 6.0, a_TexCoord.y - offsetY * 6.0);
v_TexCoord[1] = vec2(a_TexCoord.x - offsetX * 5.0, a_TexCoord.y - offsetY * 5.0);
v_TexCoord[2] = vec2(a_TexCoord.x - offsetX * 4.0, a_TexCoord.y - offsetY * 4.0);
v_TexCoord[3] = vec2(a_TexCoord.x - offsetX * 3.0, a_TexCoord.y - offsetY * 3.0);
v_TexCoord[4] = vec2(a_TexCoord.x - offsetX * 2.0, a_TexCoord.y - offsetY * 2.0);
v_TexCoord[5] = vec2(a_TexCoord.x - offsetX, a_TexCoord.y - offsetY);
v_TexCoord[6] = vec2(a_TexCoord.x, a_TexCoord.y);
v_TexCoord[7] = vec2(a_TexCoord.x + offsetX, a_TexCoord.y + offsetY);
v_TexCoord[8] = vec2(a_TexCoord.x + offsetX * 2.0, a_TexCoord.y + offsetY * 2.0);
v_TexCoord[9] = vec2(a_TexCoord.x + offsetX * 3.0, a_TexCoord.y + offsetY * 3.0);
v_TexCoord[10] = vec2(a_TexCoord.x + offsetX * 4.0, a_TexCoord.y + offsetY * 4.0);
v_TexCoord[11] = vec2(a_TexCoord.x + offsetX * 5.0, a_TexCoord.y + offsetY * 5.0);
v_TexCoord[12] = vec2(a_TexCoord.x + offsetX * 6.0, a_TexCoord.y + offsetY * 6.0);
#endif
#if KERNEL == 1
v_TexCoord[0] = vec2(a_TexCoord.x - offsetX * 3.0, a_TexCoord.y - offsetY * 3.0);
v_TexCoord[1] = vec2(a_TexCoord.x - offsetX * 2.0, a_TexCoord.y - offsetY * 2.0);
v_TexCoord[2] = vec2(a_TexCoord.x - offsetX, a_TexCoord.y - offsetY);
v_TexCoord[3] = vec2(a_TexCoord.x, a_TexCoord.y);
v_TexCoord[4] = vec2(a_TexCoord.x + offsetX, a_TexCoord.y + offsetY);
v_TexCoord[5] = vec2(a_TexCoord.x + offsetX * 2.0, a_TexCoord.y + offsetY * 2.0);
v_TexCoord[6] = vec2(a_TexCoord.x + offsetX * 3.0, a_TexCoord.y + offsetY * 3.0);
#endif
#if KERNEL == 2
v_TexCoord[0] = vec2(a_TexCoord.x - offsetX, a_TexCoord.y - offsetY);
v_TexCoord[1] = vec2(a_TexCoord.x, a_TexCoord.y);
v_TexCoord[2] = vec2(a_TexCoord.x + offsetX, a_TexCoord.y + offsetY);
#endif
}

View File

@@ -0,0 +1,4 @@
{
"name": "FX Preview",
"type": "scene2d"
}

View File

@@ -0,0 +1,41 @@
// [COMBO] {"material":"ui_editor_properties_greyscale","combo":"GREYSCALE","type":"options","default":0}
varying vec4 v_TexCoord;
uniform sampler2D g_Texture0; // {"hidden":true}
uniform sampler2D g_Texture1; // {"label":"ui_editor_properties_opacity_mask","mode":"opacitymask","combo":"MASK","paintdefaultcolor":"0 0 0 1"}
uniform sampler2D g_Texture2; // {"hidden":true}
#ifdef HLSL_SM30
uniform vec4 g_Texture0Resolution;
#endif
uniform float g_Amount; // {"material":"strength","label":"ui_editor_properties_strength","default":1.0,"range":[0.01, 5]}
void main() {
vec2 blurredCoords = v_TexCoord.xy;
#ifdef HLSL_SM30
blurredCoords += 0.75 / g_Texture0Resolution.zw;
#endif
vec4 blurred = texSample2D(g_Texture0, blurredCoords);
vec4 albedo = texSample2D(g_Texture2, v_TexCoord.xy);
vec3 delta = albedo.rgb - blurred.rgb;
#if GREYSCALE
delta = CAST3(dot(vec3(0.11, 0.59, 0.3), delta));
#endif
vec3 enhanced = albedo.rgb + delta * g_Amount;
#if MASK
float mask = texSample2D(g_Texture1, v_TexCoord.zw).r;
#else
float mask = 1.0;
#endif
albedo.rgb = mix(albedo.rgb, enhanced.rgb, mask);
gl_FragColor = albedo;
}

View File

@@ -0,0 +1,16 @@
uniform mat4 g_ModelViewProjectionMatrix;
uniform vec4 g_Texture1Resolution;
attribute vec3 a_Position;
attribute vec2 a_TexCoord;
varying vec4 v_TexCoord;
void main() {
gl_Position = mul(vec4(a_Position, 1.0), g_ModelViewProjectionMatrix);
v_TexCoord.xy = a_TexCoord;
v_TexCoord.zw = vec2(v_TexCoord.x * g_Texture1Resolution.z / g_Texture1Resolution.x,
v_TexCoord.y * g_Texture1Resolution.w / g_Texture1Resolution.y);
}

View File

@@ -0,0 +1,19 @@
varying vec2 v_TexCoord[4];
uniform sampler2D g_Texture0; // {"hidden":true}
void main() {
float weight = 0.0;
vec4 result = CAST4(0.0);
for (int i = 0; i < 4; ++i)
{
vec4 sample = texSample2D(g_Texture0, v_TexCoord[i]);
result += sample * sample.a;
weight += sample.a;
}
gl_FragColor.rgb = result.rgb / max(0.001, weight);
gl_FragColor.a = result.a / 4.0;
}

View File

@@ -0,0 +1,17 @@
attribute vec3 a_Position;
attribute vec2 a_TexCoord;
varying vec2 v_TexCoord[4];
uniform vec4 g_Texture0Resolution;
void main() {
gl_Position = vec4(a_Position, 1.0);
vec2 offsets = 1.0 / g_Texture0Resolution.xy;
v_TexCoord[0] = a_TexCoord - offsets;
v_TexCoord[1] = a_TexCoord + vec2(offsets.x, -offsets.y);
v_TexCoord[2] = a_TexCoord + vec2(-offsets.x, offsets.y);
v_TexCoord[3] = a_TexCoord + offsets;
}

View File

@@ -0,0 +1,46 @@
#if KERNEL == 0
varying vec2 v_TexCoord[13];
#endif
#if KERNEL == 1
varying vec2 v_TexCoord[7];
#endif
#if KERNEL == 2
varying vec2 v_TexCoord[3];
#endif
uniform sampler2D g_Texture0; // {"hidden":true}
void main() {
#if KERNEL == 0
vec4 albedo = texSample2D(g_Texture0, v_TexCoord[0]) * 0.006299 +
texSample2D(g_Texture0, v_TexCoord[1]) * 0.017298 +
texSample2D(g_Texture0, v_TexCoord[2]) * 0.039533 +
texSample2D(g_Texture0, v_TexCoord[3]) * 0.075189 +
texSample2D(g_Texture0, v_TexCoord[4]) * 0.119007 +
texSample2D(g_Texture0, v_TexCoord[5]) * 0.156756 +
texSample2D(g_Texture0, v_TexCoord[6]) * 0.171834 +
texSample2D(g_Texture0, v_TexCoord[7]) * 0.156756 +
texSample2D(g_Texture0, v_TexCoord[8]) * 0.119007 +
texSample2D(g_Texture0, v_TexCoord[9]) * 0.075189 +
texSample2D(g_Texture0, v_TexCoord[10]) * 0.039533 +
texSample2D(g_Texture0, v_TexCoord[11]) * 0.017298 +
texSample2D(g_Texture0, v_TexCoord[12]) * 0.006299;
#endif
#if KERNEL == 1
vec4 albedo = texSample2D(g_Texture0, v_TexCoord[0]) * 0.071303 +
texSample2D(g_Texture0, v_TexCoord[1]) * 0.131514 +
texSample2D(g_Texture0, v_TexCoord[2]) * 0.189879 +
texSample2D(g_Texture0, v_TexCoord[3]) * 0.214607 +
texSample2D(g_Texture0, v_TexCoord[4]) * 0.189879 +
texSample2D(g_Texture0, v_TexCoord[5]) * 0.131514 +
texSample2D(g_Texture0, v_TexCoord[6]) * 0.071303;
#endif
#if KERNEL == 2
vec4 albedo = texSample2D(g_Texture0, v_TexCoord[0]) * 0.25 +
texSample2D(g_Texture0, v_TexCoord[1]) * 0.5 +
texSample2D(g_Texture0, v_TexCoord[2]) * 0.25;
#endif
gl_FragColor = albedo;
}

View File

@@ -0,0 +1,61 @@
// [COMBO] {"material":"ui_editor_properties_kernel_size","combo":"KERNEL","type":"options","default":0,"options":{"13x13":0,"7x7":1,"3x3":2}}
uniform vec2 g_Scale; // {"material":"scale","label":"ui_editor_properties_scale","default":"1 1","linked":true,"range":[0.01, 2.0]}
attribute vec3 a_Position;
attribute vec2 a_TexCoord;
#if KERNEL == 0
varying vec2 v_TexCoord[13];
#endif
#if KERNEL == 1
varying vec2 v_TexCoord[7];
#endif
#if KERNEL == 2
varying vec2 v_TexCoord[3];
#endif
uniform vec4 g_Texture0Resolution;
void main() {
gl_Position = vec4(a_Position, 1.0);
#if VERTICAL
float offsetX = 0.0f;
float offsetY = g_Scale.y / g_Texture0Resolution.w;
#else
float offsetX = g_Scale.x / g_Texture0Resolution.z;
float offsetY = 0.0f;
#endif
#if KERNEL == 0
v_TexCoord[0] = vec2(a_TexCoord.x - offsetX * 6.0, a_TexCoord.y - offsetY * 6.0);
v_TexCoord[1] = vec2(a_TexCoord.x - offsetX * 5.0, a_TexCoord.y - offsetY * 5.0);
v_TexCoord[2] = vec2(a_TexCoord.x - offsetX * 4.0, a_TexCoord.y - offsetY * 4.0);
v_TexCoord[3] = vec2(a_TexCoord.x - offsetX * 3.0, a_TexCoord.y - offsetY * 3.0);
v_TexCoord[4] = vec2(a_TexCoord.x - offsetX * 2.0, a_TexCoord.y - offsetY * 2.0);
v_TexCoord[5] = vec2(a_TexCoord.x - offsetX, a_TexCoord.y - offsetY);
v_TexCoord[6] = vec2(a_TexCoord.x, a_TexCoord.y);
v_TexCoord[7] = vec2(a_TexCoord.x + offsetX, a_TexCoord.y + offsetY);
v_TexCoord[8] = vec2(a_TexCoord.x + offsetX * 2.0, a_TexCoord.y + offsetY * 2.0);
v_TexCoord[9] = vec2(a_TexCoord.x + offsetX * 3.0, a_TexCoord.y + offsetY * 3.0);
v_TexCoord[10] = vec2(a_TexCoord.x + offsetX * 4.0, a_TexCoord.y + offsetY * 4.0);
v_TexCoord[11] = vec2(a_TexCoord.x + offsetX * 5.0, a_TexCoord.y + offsetY * 5.0);
v_TexCoord[12] = vec2(a_TexCoord.x + offsetX * 6.0, a_TexCoord.y + offsetY * 6.0);
#endif
#if KERNEL == 1
v_TexCoord[0] = vec2(a_TexCoord.x - offsetX * 3.0, a_TexCoord.y - offsetY * 3.0);
v_TexCoord[1] = vec2(a_TexCoord.x - offsetX * 2.0, a_TexCoord.y - offsetY * 2.0);
v_TexCoord[2] = vec2(a_TexCoord.x - offsetX, a_TexCoord.y - offsetY);
v_TexCoord[3] = vec2(a_TexCoord.x, a_TexCoord.y);
v_TexCoord[4] = vec2(a_TexCoord.x + offsetX, a_TexCoord.y + offsetY);
v_TexCoord[5] = vec2(a_TexCoord.x + offsetX * 2.0, a_TexCoord.y + offsetY * 2.0);
v_TexCoord[6] = vec2(a_TexCoord.x + offsetX * 3.0, a_TexCoord.y + offsetY * 3.0);
#endif
#if KERNEL == 2
v_TexCoord[0] = vec2(a_TexCoord.x - offsetX, a_TexCoord.y - offsetY);
v_TexCoord[1] = vec2(a_TexCoord.x, a_TexCoord.y);
v_TexCoord[2] = vec2(a_TexCoord.x + offsetX, a_TexCoord.y + offsetY);
#endif
}