This commit is contained in:
2025-02-07 17:04:43 -06:00
parent 33fd7ddf72
commit 8eec81c7f4
2249 changed files with 75331 additions and 685 deletions

View File

@@ -0,0 +1,96 @@
{
"name" : "ui_editor_effect_shine_title",
"description" : "ui_editor_effect_shine_description",
"group" : "enhance",
"preview" : "preview/project.json",
"passes" :
[
{
"material" : "materials/effects/shine_downsample2.json",
"target" : "_rt_HalfCompoBuffer1",
"bind" :
[
{
"name" : "previous",
"index" : 0
}
]
},
{
"material" : "materials/effects/shine_cast.json",
"target" : "_rt_HalfCompoBuffer2",
"bind" :
[
{
"name" : "_rt_HalfCompoBuffer1",
"index" : 0
}
]
},
{
"material" : "materials/effects/shine_gaussian_x.json",
"target" : "_rt_HalfCompoBuffer1",
"bind" :
[
{
"name" : "_rt_HalfCompoBuffer2",
"index" : 0
}
]
},
{
"material" : "materials/effects/shine_gaussian_y.json",
"target" : "_rt_HalfCompoBuffer2",
"bind" :
[
{
"name" : "_rt_HalfCompoBuffer1",
"index" : 0
}
]
},
{
"material" : "materials/effects/shine_combine.json",
"bind" :
[
{
"name" : "_rt_HalfCompoBuffer2",
"index" : 0
},
{
"name" : "previous",
"index" : 1
}
]
}
],
"fbos" :
[
{
"name" : "_rt_HalfCompoBuffer1",
"scale" : 2,
"format" : "rgba8888"
},
{
"name" : "_rt_HalfCompoBuffer2",
"scale" : 2,
"format" : "rgba8888"
}
],
"dependencies" :
[
"materials/effects/shine_downsample2.json",
"materials/effects/shine_cast.json",
"materials/effects/shine_gaussian_x.json",
"materials/effects/shine_gaussian_y.json",
"materials/effects/shine_combine.json",
"shaders/effects/shine_downsample2.frag",
"shaders/effects/shine_downsample2.vert",
"shaders/effects/shine_cast.frag",
"shaders/effects/shine_cast.vert",
"shaders/effects/shine_gaussian.frag",
"shaders/effects/shine_gaussian.vert",
"shaders/effects/shine_combine.frag",
"shaders/effects/shine_combine.vert"
]
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,18 @@
{
"passes" :
[
{
"blending" : "additive",
"combos" : {},
"constantshadervalues" :
{
"ui_editor_properties_overbright" : 5.0
},
"cullmode" : "normal",
"depthtest" : "disabled",
"depthwrite" : "disabled",
"shader" : "genericparticle",
"textures" : [ "particle/chromaticdot" ]
}
]
}

View File

@@ -0,0 +1,122 @@
{
"animationmode" : null,
"children" : null,
"controlpoint" :
[
{
"flags" : 0,
"id" : 0,
"offset" : "0 0 0"
},
{
"flags" : 0,
"id" : 1,
"offset" : "0 0 0"
},
{
"flags" : 0,
"id" : 2,
"offset" : "0 0 0"
},
{
"flags" : 0,
"id" : 3,
"offset" : "0 0 0"
},
{
"flags" : 0,
"id" : 4,
"offset" : "0 0 0"
},
{
"flags" : 0,
"id" : 5,
"offset" : "0 0 0"
},
{
"flags" : 0,
"id" : 6,
"offset" : "0 0 0"
},
{
"flags" : 0,
"id" : 7,
"offset" : "0 0 0"
}
],
"emitter" :
[
{
"directions" : "1 0 0",
"distancemax" : 150,
"distancemin" : 0,
"id" : 6,
"name" : "sphererandom",
"origin" : "0 0 0",
"rate" : 15
}
],
"flags" : null,
"initializer" :
[
{
"id" : 2,
"max" : 5,
"min" : 3,
"name" : "lifetimerandom"
},
{
"id" : 3,
"max" : 30,
"min" : 10,
"name" : "sizerandom"
},
{
"id" : 4,
"max" : "-37 -90 0",
"min" : "-10 -50 0",
"name" : "velocityrandom"
},
{
"id" : 5,
"max" : "95 98 100",
"min" : "255 255 255",
"name" : "colorrandom"
}
],
"material" : "materials/presets/snowflat.json",
"maxcount" : 300,
"operator" :
[
{
"gravity" : "0 0 0",
"id" : 7,
"name" : "movement"
},
{
"frequencymax" : 1.0,
"frequencymin" : 0.80000000000000004,
"id" : 8,
"mask" : "1 0.5 0",
"name" : "oscillateposition",
"phasemax" : 1,
"phasemin" : 0,
"scalemax" : 35,
"scalemin" : 20
},
{
"fadeintime" : 0.10000000000000001,
"id" : 9,
"name" : "alphafade"
}
],
"renderer" :
[
{
"id" : 1,
"name" : "sprite"
}
],
"sequencemultiplier" : null,
"starttime" : 15
}

View File

@@ -0,0 +1,84 @@
{
"name" : "ui_editor_preset_snow_particles_title",
"description" : "ui_editor_preset_snow_particles_description",
"tag" : "scene2d",
"group" : "preset",
"options" :
{
"droplistVisible" : true,
"droplistOptions" :
[
{
"label" : "Snow perspective",
"value" : 0
},
{
"label" : "Snow flat",
"value" : 1
},
{
"label" : "Snow storm",
"value" : 2
}
]
},
"variants" :
[
{
"preview" : "previewperspective/project.json",
"objects" :
[
{
"angles" : "0.000 0.000 0.000",
"name" : "Snow perspective",
"origin" : "0.000 0.000 0.000",
"particle" : "particles/presets/snowperspective.json",
"scale" : "1.000 1.000 1.000"
}
],
"dependencies" :
[
"materials/presets/snowperspective.json",
"particles/presets/snowperspective.json"
]
},
{
"preview" : "previewflat/project.json",
"objects" :
[
{
"angles" : "0.000 0.000 0.000",
"name" : "Snow flat",
"origin" : "0.000 0.000 0.000",
"particle" : "particles/presets/snowflat.json",
"scale" : "1.000 1.000 1.000"
}
],
"dependencies" :
[
"materials/presets/snowflat.json",
"particles/presets/snowflat.json"
]
},
{
"preview" : "previewstorm/project.json",
"objects" :
[
{
"angles" : "0.000 0.000 0.000",
"name" : "Snow storm",
"origin" : "0.000 0.000 0.000",
"particle" : "particles/presets/snowstorm.json",
"scale" : "1.000 1.000 1.000"
}
],
"dependencies" :
[
"materials/presets/snowstorm.json",
"materials/presets/snowstormfog.json",
"particles/presets/snowstorm.json",
"particles/presets/snowstormfog.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,99 @@
{
"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 0 0",
"clearenabled" : null,
"orthogonalprojection" :
{
"height" : 256,
"width" : 256
},
"skylightcolor" : "0.3 0.3 0.3"
},
"objects" :
[
{
"angles" : "0.000 0.000 0.000",
"id" : 22,
"image" : null,
"instanceoverride" : null,
"model" : null,
"name" : "Snow flat",
"origin" : "181.267 289.241 0.000",
"parallaxDepth" : "1.000 1.000",
"particle" : "particles/presets/snowflat.json",
"scale" : "1.000 1.000 1.000"
},
{
"angles" : "0.000 0.000 0.000",
"colorBlendMode" : 0,
"copybackground" : true,
"dependencies" : [ 25 ],
"effects" :
[
{
"file" : "effects/shine/effect.json",
"passes" :
[
{
"constantshadervalues" :
{
"ui_editor_properties_ray_threshold" : 0.0
},
"textures" : [ null, "util/white", "util/clouds_256" ]
},
{
"constantshadervalues" :
{
"ui_editor_properties_color" : "1 0.2196078431372549 0",
"ui_editor_properties_direction" : 0.0,
"ui_editor_properties_ray_intensity" : 1.3600000143051147,
"ui_editor_properties_ray_length" : 0.41999998688697815,
"ui_editor_properties_speed" : -0.33000001311302185
}
},
{},
{
"combos" :
{
"VERTICAL" : 1
}
},
{
"textures" : [ null, "_rt_imageLayerComposite_25_a" ]
}
],
"username" : "",
"visible" : true
}
],
"id" : 25,
"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" : "194.000 196.000",
"visible" : true
}
]
}

View File

@@ -0,0 +1,100 @@
// [COMBO] {"material":"ui_editor_properties_samples","combo":"SAMPLES","type":"options","default":1,"options":{"4":0,"8":1,"15":2,"30":3,"50":4}}
varying vec4 v_TexCoord01;
varying vec4 v_TexCoord23;
varying vec4 v_TexCoord45;
uniform sampler2D g_Texture0; // {"material":"ui_editor_properties_framebuffer","hidden":true}
uniform float g_Length; // {"material":"ui_editor_properties_ray_length","default":0.1,"range":[0.01, 1]}
uniform float g_Intensity; // {"material":"ui_editor_properties_ray_intensity","default":1,"range":[0.01, 2.0]}
uniform vec3 g_ColorRays; // {"material":"ui_editor_properties_color","default":"1 1 1","type":"color"}
vec4 GatherDirection(vec2 texCoords, vec2 direction)
{
vec4 albedo = CAST4(0.0);
#if SAMPLES == 0
const int sampleCount = 4;
#endif
#if SAMPLES == 1
const int sampleCount = 8;
#endif
#if SAMPLES == 2
const int sampleCount = 15;
#endif
#if SAMPLES == 3
const int sampleCount = 30;
#endif
#if SAMPLES == 4
const int sampleCount = 50;
#endif
float dist = length(direction);
direction /= dist;
dist = min(dist, dist * g_Length);
texCoords += direction * dist;
const float sampleDrop = sampleCount - 1;
direction = direction * dist / sampleDrop;
for (int i = 0; i < sampleCount; ++i)
{
vec4 sample = texSample2D(g_Texture0, texCoords);
texCoords -= direction;
albedo += sample * (i / sampleDrop);
}
return albedo;
}
void main() {
vec2 texCoords = v_TexCoord01.xy;
vec4 albedo = CAST4(0.0);
#if EDGES == 2
albedo += GatherDirection(texCoords, v_TexCoord01.zw);
albedo += GatherDirection(texCoords, -v_TexCoord01.zw);
#endif
#if EDGES == 3
albedo += GatherDirection(texCoords, v_TexCoord01.zw);
albedo += GatherDirection(texCoords, v_TexCoord23.xy);
albedo += GatherDirection(texCoords, v_TexCoord23.zw);
#endif
#if EDGES == 4
albedo += GatherDirection(texCoords, v_TexCoord01.zw);
albedo += GatherDirection(texCoords, -v_TexCoord01.zw);
albedo += GatherDirection(texCoords, v_TexCoord23.xy);
albedo += GatherDirection(texCoords, -v_TexCoord23.xy);
#endif
#if EDGES == 5
albedo += GatherDirection(texCoords, v_TexCoord01.zw);
albedo += GatherDirection(texCoords, v_TexCoord23.xy);
albedo += GatherDirection(texCoords, v_TexCoord23.zw);
albedo += GatherDirection(texCoords, v_TexCoord45.xy);
albedo += GatherDirection(texCoords, v_TexCoord45.zw);
#endif
#if SAMPLES == 0
const float sampleIntensity = 0.1 * (30 / 4.0);
#endif
#if SAMPLES == 1
const float sampleIntensity = 0.1 * (30 / 8.0);
#endif
#if SAMPLES == 2
const float sampleIntensity = 0.1 * (30 / 15.0);
#endif
#if SAMPLES == 3
const float sampleIntensity = 0.1;
#endif
#if SAMPLES == 4
const float sampleIntensity = 0.1 * (30 / 50.0);
#endif
albedo.rgb *= g_ColorRays;
gl_FragColor = g_Intensity * sampleIntensity * albedo;
}

View File

@@ -0,0 +1,60 @@
// [COMBO] {"material":"ui_editor_properties_edges","combo":"EDGES","type":"options","default":4,"options":{"2":2,"3":3,"4":4,"5":5}}
#include "common.h"
uniform mat4 g_ModelViewProjectionMatrix;
uniform vec4 g_Texture0Resolution;
uniform float g_Time;
attribute vec3 a_Position;
attribute vec2 a_TexCoord;
uniform float g_Direction; // {"material":"ui_editor_properties_direction","default":0,"range":[0,6.28]}
uniform float g_Speed; // {"material":"ui_editor_properties_speed","default":0,"range":[-1,1]}
varying vec4 v_TexCoord01;
varying vec4 v_TexCoord23;
varying vec4 v_TexCoord45;
void main() {
gl_Position = vec4(a_Position, 1.0);
v_TexCoord01.xy = a_TexCoord;
vec2 baseDirection = rotateVec2(vec2(0, 0.5), g_Time * g_Speed);
float ratio = g_Texture0Resolution.x / g_Texture0Resolution.y;
#if EDGES == 2
v_TexCoord01.zw = rotateVec2(baseDirection, g_Direction);
v_TexCoord23.xy = CAST2(0.0);
v_TexCoord23.zw = CAST2(0.0);
v_TexCoord45.xy = CAST2(0.0);
v_TexCoord45.zw = CAST2(0.0);
#endif
#if EDGES == 3
v_TexCoord01.zw = rotateVec2(baseDirection, g_Direction);
v_TexCoord23.xy = rotateVec2(baseDirection, g_Direction + M_PI_2 * 0.3333);
v_TexCoord23.zw = rotateVec2(baseDirection, g_Direction + M_PI_2 * 0.6666);
v_TexCoord45.xy = CAST2(0.0);
v_TexCoord45.zw = CAST2(0.0);
#endif
#if EDGES == 4
v_TexCoord01.zw = rotateVec2(baseDirection, g_Direction);
v_TexCoord23.xy = rotateVec2(vec2(-baseDirection.y, baseDirection.x), g_Direction);
v_TexCoord23.zw = CAST2(0.0);
v_TexCoord45.xy = CAST2(0.0);
v_TexCoord45.zw = CAST2(0.0);
#endif
#if EDGES == 5
v_TexCoord01.zw = rotateVec2(baseDirection, g_Direction);
v_TexCoord23.xy = rotateVec2(baseDirection, g_Direction + M_PI_2 * 0.2);
v_TexCoord23.zw = rotateVec2(baseDirection, g_Direction + M_PI_2 * 0.4);
v_TexCoord45.xy = rotateVec2(baseDirection, g_Direction + M_PI_2 * 0.6);
v_TexCoord45.zw = rotateVec2(baseDirection, g_Direction + M_PI_2 * 0.8);
#endif
v_TexCoord01.w *= ratio;
v_TexCoord23.yw *= ratio;
v_TexCoord45.yw *= ratio;
}

View File

@@ -0,0 +1,24 @@
// [COMBO] {"material":"ui_editor_properties_blend_mode","combo":"BLENDMODE","type":"imageblending","default":9}
#include "common_blending.h"
varying vec4 v_TexCoord;
uniform sampler2D g_Texture0; // {"material":"ui_editor_properties_framebuffer","hidden":true}
uniform sampler2D g_Texture1; // {"material":"Prev","hidden":true}
void main() {
vec4 rays = texSample2D(g_Texture0, v_TexCoord.zw);
vec4 albedo = texSample2D(g_Texture1, v_TexCoord.xy);
#if BLENDMODE == 0
albedo = rays;
#else
albedo.rgb = ApplyBlending(BLENDMODE, albedo.rgb, rays.rgb, rays.a);
albedo.a += rays.a;
#endif
gl_FragColor = albedo;
}

View File

@@ -0,0 +1,22 @@
uniform mat4 g_ModelViewProjectionMatrix;
uniform vec4 g_Texture1Resolution;
attribute vec3 a_Position;
attribute vec2 a_TexCoord;
varying vec4 v_TexCoord;
#ifdef HLSL_SM30
uniform vec4 g_Texture0Resolution;
#endif
void main() {
gl_Position = mul(vec4(a_Position, 1.0), g_ModelViewProjectionMatrix);
v_TexCoord = a_TexCoord.xyxy;
#ifdef HLSL_SM30
v_TexCoord.zw += 0.5 / g_Texture0Resolution.xy;
#endif
}

View File

@@ -0,0 +1,35 @@
// [COMBO] {"material":"ui_editor_properties_noise","combo":"NOISE","type":"options","default":1}
varying vec4 v_TexCoord;
uniform sampler2D g_Texture0; // {"material":"ui_editor_properties_framebuffer","hidden":true}
uniform sampler2D g_Texture1; // {"material":"ui_editor_properties_opacity_mask","mode":"opacitymask","default":"util/white"}
uniform float g_Threshold; // {"material":"ui_editor_properties_ray_threshold","default":0.5,"range":[0, 1]}
#if NOISE == 1
varying vec4 v_NoiseTexCoord;
uniform sampler2D g_Texture2; // {"material":"ui_editor_properties_albedo","default":"util/clouds_256"}
uniform float g_NoiseAmount; // {"material":"ui_editor_properties_noise_amount","default":0.4,"range":[0.01, 1]}
#endif
void main() {
float mask = texSample2D(g_Texture1, v_TexCoord.zw).r;
vec4 sample = texSample2D(g_Texture0, v_TexCoord.xy);
#if NOISE == 1
float noiseSample = texSample2D(g_Texture2, v_NoiseTexCoord.xy).r * texSample2D(g_Texture2, v_NoiseTexCoord.zw).r;
noiseSample = mix(sample.a, sample.a * noiseSample, g_NoiseAmount);
#endif
sample.rgb *= sample.a;
sample.a = 1.0;
gl_FragColor = sample * mask * step(g_Threshold, dot(vec3(0.11, 0.59, 0.3), sample.rgb));
#if NOISE == 1
gl_FragColor.a *= noiseSample;
#endif
}

View File

@@ -0,0 +1,35 @@
attribute vec3 a_Position;
attribute vec2 a_TexCoord;
varying vec4 v_TexCoord;
uniform vec4 g_Texture0Resolution;
uniform vec4 g_Texture1Resolution;
#if NOISE == 1
varying vec4 v_NoiseTexCoord;
#endif
uniform float g_Time;
uniform float g_NoiseSpeed; // {"material":"ui_editor_properties_noise_speed","default":0.15,"range":[0.01, 1]}
uniform float g_NoiseScale; // {"material":"ui_editor_properties_noise_scale","default":3,"range":[0.01, 10]}
void main() {
gl_Position = vec4(a_Position, 1.0);
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);
#ifdef HLSL_SM30
vec2 offsets = 0.5 / g_Texture0Resolution.xy;
v_TexCoord.xy += offsets;
#endif
#if NOISE == 1
v_NoiseTexCoord.xy = a_TexCoord + g_Time * g_NoiseSpeed;
v_NoiseTexCoord.wz = vec2(a_TexCoord.y, -a_TexCoord.x) * 0.633 + vec2(-g_Time, g_Time) * 0.5 * g_NoiseSpeed;
v_NoiseTexCoord *= g_NoiseScale;
#endif
}

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":"ui_editor_properties_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":"ui_editor_properties_kernel_size","combo":"KERNEL","type":"options","default":1,"options":{"13x13":0,"7x7":1,"3x3":2}}
uniform vec2 g_Scale; // {"material":"ui_editor_properties_blur_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"
}