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,20 @@
{
"version" : 1,
"replacementkey" : "chromatic_aberration",
"name" : "ui_editor_effect_chromatic_abberation_title",
"description" : "ui_editor_effect_chromatic_abberation_description",
"group" : "colorize",
"preview" : "preview/project.json",
"passes" :
[
{
"material" : "materials/effects/chromatic_aberration.json"
}
],
"dependencies" :
[
"materials/effects/chromatic_aberration.json",
"shaders/effects/chromatic_aberration.frag",
"shaders/effects/chromatic_aberration.vert"
]
}

View File

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

View File

@@ -0,0 +1,20 @@
{
"version" : 1,
"replacementkey" : "chromatic_aberration",
"name" : "ui_editor_effect_chromatic_abberation_title",
"description" : "ui_editor_effect_chromatic_abberation_description",
"group" : "colorize",
"preview" : "preview/project.json",
"passes" :
[
{
"material" : "materials/effects/chromatic_aberration.json"
}
],
"dependencies" :
[
"materials/effects/chromatic_aberration.json",
"shaders/effects/chromatic_aberration.frag",
"shaders/effects/chromatic_aberration.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/chromatic_aberration",
"blending": "normal",
"depthtest": "disabled",
"depthwrite": "disabled",
"cullmode": "nocull"
}]
}

View File

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

View File

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

View File

@@ -0,0 +1,95 @@
{
"camera" :
{
"center" : "0.00000 0.00000 -1.00000",
"eye" : "0.00000 0.00000 0.00000",
"up" : "0.00000 1.00000 0.00000"
},
"general" :
{
"ambientcolor" : "0.30000 0.30000 0.30000",
"bloom" : false,
"bloomhdrfeather" : 0.1,
"bloomhdriterations" : 8,
"bloomhdrscatter" : 1.619,
"bloomhdrstrength" : 2.0,
"bloomhdrthreshold" : 1.0,
"bloomstrength" : 2.0,
"bloomthreshold" : 0.64999998,
"camerafade" : true,
"cameraparallax" : false,
"cameraparallaxamount" : 0.5,
"cameraparallaxdelay" : 0.1,
"cameraparallaxmouseinfluence" : 0.0,
"camerapreview" : true,
"camerashake" : false,
"camerashakeamplitude" : 0.5,
"camerashakeroughness" : 1.0,
"camerashakespeed" : 3.0,
"clearcolor" : "0.70000 0.70000 0.70000",
"clearenabled" : true,
"farz" : 10000.0,
"fov" : 50.0,
"hdr" : false,
"nearz" : 0.0099999998,
"orthogonalprojection" :
{
"height" : 256,
"width" : 256
},
"skylightcolor" : "0.30000 0.30000 0.30000",
"zoom" : 1.0
},
"objects" :
[
{
"alignment" : "center",
"alpha" : 1.0,
"angles" : "0.00000 0.00000 0.00000",
"brightness" : 1.0,
"color" : "1.00000 1.00000 1.00000",
"colorBlendMode" : 0,
"copybackground" : true,
"depth" : 1,
"effects" :
[
{
"file" : "effects/chromaticaberration/effect.json",
"id" : 18,
"name" : "",
"passes" :
[
{
"combos" :
{
"MODE" : 0,
"VARIATION" : 0
},
"constantshadervalues" :
{
"ui_editor_properties_center" : "0.5 0.5",
"ui_editor_properties_center_falloff" : 0.5,
"ui_editor_properties_strength" : 9
},
"id" : 19
}
],
"visible" : true
}
],
"id" : 38,
"image" : "models/effectpreview.json",
"ledsource" : false,
"locktransforms" : false,
"name" : "",
"origin" : "128.00000 128.00000 0.00000",
"parallaxDepth" : "1.00000 1.00000",
"perspective" : false,
"scale" : "1.00000 1.00000 1.00000",
"size" : "256.00000 256.00000",
"solid" : true,
"visible" : true
}
],
"version" : 0
}

View File

@@ -0,0 +1,61 @@
// [COMBO] {"material":"ui_editor_properties_chroma","combo":"VARIATION","type":"options","default":0,"options":{"Red, blue":0,"Yellow, purple":1,"Magenta, green":2}}
// [COMBO] {"material":"ui_editor_properties_mode","combo":"MODE","type":"options","default":0,"options":{"Expansion":0,"Directional":1,"Radial":2}}
#include "common.h"
uniform sampler2D g_Texture0; // {"hidden":true}
uniform float u_Direction; // {"material":"ui_editor_properties_direction","default":1.57079632679,"direction":true,"conversion":"rad2deg"}
uniform float u_Strength; // {"material":"ui_editor_properties_strength","default":1,"range":[0,2]}
uniform float u_CenterFalloff; // {"material":"ui_editor_properties_center_falloff","default":1,"range":[0,1]}
uniform vec2 u_Center; // {"material":"ui_editor_properties_center","position":true,"default":"0.5 0.5"}
varying vec2 v_TexCoord;
void main() {
vec2 delta = v_TexCoord.xy - u_Center;
#if MODE == 0
float falloff = mix(0.5 / (length(delta) + 0.0001), 1.0, u_CenterFalloff);
delta *= u_Strength * 0.01 * falloff;
vec2 coords0 = v_TexCoord.xy + delta;
vec2 coords1 = v_TexCoord.xy - delta;
#endif
#if MODE == 1
vec2 direction = vec2(-sin(u_Direction), cos(u_Direction));
float falloff = mix(1.0, abs(dot(direction, delta)) * 2.0, u_CenterFalloff);
direction *= u_Strength * 0.01 * falloff;
vec2 coords0 = v_TexCoord.xy + direction;
vec2 coords1 = v_TexCoord.xy - direction;
#endif
#if MODE == 2
float falloff = mix(0.5 / (length(delta) + 0.0001), 1.0, u_CenterFalloff);
float amt = u_Strength * 0.01 * falloff;
vec2 coords0 = u_Center + rotateVec2(delta, amt);
vec2 coords1 = u_Center + rotateVec2(delta, -amt);
#endif
vec4 albedo = texSample2D(g_Texture0, v_TexCoord);
vec4 s0 = texSample2D(g_Texture0, coords0);
vec4 s1 = texSample2D(g_Texture0, coords1);
#if VARIATION == 0
albedo.r = s0.r;
albedo.b = s1.b;
#endif
#if VARIATION == 1
albedo.g = s1.g;
albedo.b = s0.b;
#endif
#if VARIATION == 2
albedo.g = s0.g;
albedo.r = s1.r;
#endif
gl_FragColor = albedo;
}

View File

@@ -0,0 +1,12 @@
uniform mat4 g_ModelViewProjectionMatrix;
attribute vec3 a_Position;
attribute vec2 a_TexCoord;
varying vec2 v_TexCoord;
void main() {
gl_Position = mul(vec4(a_Position, 1.0), g_ModelViewProjectionMatrix);
v_TexCoord.xy = a_TexCoord;
}

View File

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

View File

@@ -0,0 +1,90 @@
// [COMBO] {"material":"ui_editor_properties_chroma","combo":"VARIATION","type":"options","default":0,"options":{"ui_editor_properties_chroma_red_blue":0,"ui_editor_properties_chroma_yellow_purple":1,"ui_editor_properties_chroma_magenta_green":2}}
// [COMBO] {"material":"ui_editor_properties_mode","combo":"MODE","type":"options","default":0,"options":{"ui_editor_properties_expansion":0,"ui_editor_properties_directional":1,"ui_editor_properties_radial":2,"ui_editor_properties_barrel":3}}
#include "common.h"
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 float u_Direction; // {"material":"ui_editor_properties_direction","default":1.57079632679,"direction":true,"conversion":"rad2deg"}
uniform float u_Strength; // {"material":"ui_editor_properties_strength","default":1,"range":[0,2]}
uniform float u_CenterFalloff; // {"material":"ui_editor_properties_center_falloff","default":1,"range":[0,1]}
uniform vec2 u_Center; // {"material":"ui_editor_properties_center","position":true,"default":"0.5 0.5"}
varying vec4 v_TexCoord;
#if MODE == 3
vec2 BC(vec2 coords, in float amt)
{
coords = coords * CAST2(2.0) - CAST2(1.0);
float v = coords.x * coords.x + coords.y * coords.y;
coords *= CAST2(1.0) + amt * v;
coords = coords * CAST2(0.5) + CAST2(0.5);
return coords;
}
#endif
void main() {
vec2 delta = v_TexCoord.xy - u_Center;
#if MODE == 0
float falloff = mix(0.5 / (length(delta) + 0.0001), 1.0, u_CenterFalloff);
delta *= u_Strength * 0.01 * falloff;
vec2 coords0 = v_TexCoord.xy + delta;
vec2 coords1 = v_TexCoord.xy - delta;
#endif
#if MODE == 1
vec2 direction = vec2(-sin(u_Direction), cos(u_Direction));
float falloff = mix(1.0, abs(dot(direction, delta)) * 2.0, u_CenterFalloff);
direction *= u_Strength * 0.01 * falloff;
vec2 coords0 = v_TexCoord.xy + direction;
vec2 coords1 = v_TexCoord.xy - direction;
#endif
#if MODE == 2
float falloff = mix(0.5 / (length(delta) + 0.0001), 1.0, u_CenterFalloff);
float amt = u_Strength * 0.01 * falloff;
vec2 coords0 = u_Center + rotateVec2(delta, amt);
vec2 coords1 = u_Center + rotateVec2(delta, -amt);
#endif
#if MODE == 3
vec2 refCoords = v_TexCoord.xy;
refCoords -= CAST2(0.5);
refCoords *= CAST2(1.0 - u_Strength * 0.0125);
refCoords += CAST2(0.5);
vec2 coords0 = BC(refCoords, u_Strength * 0.05);
vec2 coords1 = BC(refCoords, u_Strength * -0.02);
#endif
vec4 sc = texSample2D(g_Texture0, v_TexCoord.xy);
vec4 s0 = texSample2D(g_Texture0, coords0);
vec4 s1 = texSample2D(g_Texture0, coords1);
vec4 albedo = sc;
#if VARIATION == 0
albedo.r = s0.r;
albedo.b = s1.b;
#endif
#if VARIATION == 1
albedo.g = s1.g;
albedo.b = s0.b;
#endif
#if VARIATION == 2
albedo.g = s0.g;
albedo.r = s1.r;
#endif
#if MASK
float mask = texSample2D(g_Texture1, v_TexCoord.zw).r;
albedo = mix(sc, albedo, mask);
#endif
gl_FragColor = albedo;
}

View File

@@ -0,0 +1,18 @@
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 = a_TexCoord.xyxy;
#if MASK
v_TexCoord.zw = vec2(v_TexCoord.x * g_Texture1Resolution.z / g_Texture1Resolution.x,
v_TexCoord.y * g_Texture1Resolution.w / g_Texture1Resolution.y);
#endif
}