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,33 @@
{
"version" : 1,
"replacementkey" : "twirl",
"name" : "ui_editor_effect_twirl_title",
"description" : "ui_editor_effect_twirl_description",
"group" : "animate",
"preview" : "preview/project.json",
"passes" :
[
{
"material" : "materials/effects/twirl.json"
}
],
"dependencies" :
[
"materials/effects/twirl.json",
"shaders/effects/twirl.frag",
"shaders/effects/twirl.vert"
],
"gizmos" :
[
{
"type" : "EffectSpinUV",
"vars" :
{
"center" : "center",
"ratio" : "ratio",
"angle" : "angle",
"size" : "size"
}
}
]
}

View File

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

View File

@@ -0,0 +1,33 @@
{
"version" : 1,
"replacementkey" : "twirl",
"name" : "ui_editor_effect_twirl_title",
"description" : "ui_editor_effect_twirl_description",
"group" : "animate",
"preview" : "preview/project.json",
"passes" :
[
{
"material" : "materials/effects/twirl.json"
}
],
"dependencies" :
[
"materials/effects/twirl.json",
"shaders/effects/twirl.frag",
"shaders/effects/twirl.vert"
],
"gizmos" :
[
{
"type" : "EffectSpinUV",
"vars" :
{
"center" : "center",
"ratio" : "ratio",
"angle" : "angle",
"size" : "size"
}
}
]
}

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
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 KiB

View File

@@ -0,0 +1,9 @@
{
"passes": [{
"shader": "effects/twirl",
"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,101 @@
{
"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/twirl/effect.json",
"id" : 18,
"name" : "",
"passes" :
[
{
"combos" :
{
"ELLIPTICAL" : 0,
"INNER" : 1,
"NOISE" : 0,
"REPEAT" : 0
},
"constantshadervalues" :
{
"amount" : 0.23,
"angle" : 0.0,
"center" : "0.50194 0.46310",
"feather" : 0,
"ratio" : 1.0,
"size" : 0.83391356,
"speed" : 1.0
},
"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,85 @@
// [COMBO] {"material":"ui_editor_properties_elliptical","combo":"ELLIPTICAL","type":"options","default":1}
// [COMBO] {"material":"ui_editor_properties_noise","combo":"NOISE","type":"options","default":0}
// [COMBO] {"material":"ui_editor_properties_repeat","combo":"REPEAT","type":"options","default":1}
// [COMBO] {"material":"ui_editor_properties_inner","combo":"INNER","type":"options","default":0}
#include "common.h"
varying vec2 v_TexCoord;
varying vec2 v_TexCoordMask;
uniform vec4 g_Texture0Resolution;
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; // {"label":"ui_editor_properties_noise","default":"util/noise"}
uniform vec2 g_SpinCenter; // {"material":"center","label":"ui_editor_properties_center","default":"0.5 0.5","position":true}
uniform float g_Size; // {"material":"size","label":"ui_editor_properties_size","default":0.5,"range":[0,1]}
uniform float g_Feather; // {"material":"feather","label":"ui_editor_properties_feather","default":0.002,"range":[0,0.2]}
uniform float g_Amount; // {"material":"amount","label":"ui_editor_properties_amount","default":1.0,"range":[0,2.0]}
uniform float g_Speed; // {"material":"speed","label":"ui_editor_properties_speed","default":1.0,"range":[-5,5]}
uniform float g_Ratio; // {"material":"ratio","label":"ui_editor_properties_ratio","default":1.0,"range":[0,10]}
uniform float g_Axis; // {"material":"angle","label":"ui_editor_properties_angle","default":0.0,"range":[0,3.141]}
uniform float g_Time;
uniform float g_NoiseSpeed; // {"material":"noisespeed","label":"ui_editor_properties_noise_speed","default":0.15,"range":[0,0.2]}
uniform float g_NoiseAmount; // {"material":"noiseamount","label":"ui_editor_properties_noise_amount","default":0.5,"range":[0,1]}
void main() {
float aspect = g_Texture0Resolution.z / g_Texture0Resolution.w;
vec2 texCoord = v_TexCoord.xy;
texCoord -= g_SpinCenter;
texCoord.x *= aspect;
#if ELLIPTICAL
texCoord.xy = rotateVec2(texCoord.xy, g_Axis);
texCoord.x *= g_Ratio;
#endif
float feather = smoothstep(g_Size + g_Feather + 0.00001, g_Size - g_Feather, length(texCoord.xy));
#if INNER
float dist = (1.0 / length(texCoord)) * g_Size;
#else
float dist = length(texCoord) / g_Size;
#endif
float anim = sin(g_Time * g_Speed) * dist * g_Amount;
#if NOISE
float noise = texSample2D(g_Texture2, vec2(g_Time * 0.08333333, g_Time * 0.02777777) * g_NoiseSpeed).r * 3.141 * 2.0;
anim += sin(noise) * g_NoiseAmount;
#endif
texCoord = rotateVec2(texCoord, anim);
#if ELLIPTICAL
texCoord.x /= g_Ratio;
texCoord.xy = rotateVec2(texCoord.xy, -g_Axis);
#endif
texCoord.x /= aspect;
texCoord += g_SpinCenter;
#if REPEAT
texCoord = frac(texCoord);
#endif
texCoord = mix(v_TexCoord.xy, texCoord, feather);
gl_FragColor = texSample2D(g_Texture0, texCoord);
float mask = 1.0;
#if MASK
mask *= texSample2D(g_Texture1, v_TexCoordMask).r;
#endif
gl_FragColor = mix(texSample2D(g_Texture0, v_TexCoord.xy), gl_FragColor, mask);
}

View File

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

View File

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

View File

@@ -0,0 +1,83 @@
// [COMBO] {"material":"ui_editor_properties_elliptical","combo":"ELLIPTICAL","type":"options","default":1}
// [COMBO] {"material":"ui_editor_properties_noise","combo":"NOISE","type":"options","default":0}
// [COMBO] {"material":"ui_editor_properties_repeat","combo":"REPEAT","type":"options","default":1}
// [COMBO] {"material":"ui_editor_properties_inner","combo":"INNER","type":"options","default":0}
#include "common.h"
varying vec4 v_TexCoord;
#if MASK
varying vec2 v_TexCoordMask;
#endif
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; // {"label":"ui_editor_properties_noise","default":"util/noise"}
uniform vec2 g_SpinCenter; // {"material":"center","label":"ui_editor_properties_center","default":"0.5 0.5","position":true}
uniform float g_Size; // {"material":"size","label":"ui_editor_properties_size","default":0.5,"range":[0,1]}
uniform float g_Feather; // {"material":"feather","label":"ui_editor_properties_feather","default":0.002,"range":[0,0.2]}
uniform float g_Ratio; // {"material":"ratio","label":"ui_editor_properties_ratio","default":1.0,"range":[0,10]}
uniform float g_Axis; // {"material":"angle","label":"ui_editor_properties_angle","default":0.0,"range":[0,3.141]}
uniform float g_Time;
uniform float g_NoiseSpeed; // {"material":"noisespeed","label":"ui_editor_properties_noise_speed","default":0.15,"range":[0,0.2]}
uniform float g_NoiseAmount; // {"material":"noiseamount","label":"ui_editor_properties_noise_amount","default":0.5,"range":[0,1]}
void main() {
float aspect = v_TexCoord.z;
vec2 texCoord = v_TexCoord.xy;
texCoord -= g_SpinCenter;
texCoord.x *= aspect;
#if ELLIPTICAL
texCoord.xy = rotateVec2(texCoord.xy, g_Axis);
texCoord.x *= g_Ratio;
#endif
float feather = smoothstep(g_Size + g_Feather + 0.00001, g_Size - g_Feather, length(texCoord.xy));
#if INNER
float dist = (1.0 / length(texCoord)) * g_Size;
#else
float dist = length(texCoord) / g_Size;
#endif
float anim = v_TexCoord.w * dist;
#if NOISE
float noise = texSample2D(g_Texture2, vec2(g_Time * 0.08333333, g_Time * 0.02777777) * g_NoiseSpeed).r * 3.141 * 2.0;
anim += sin(noise) * g_NoiseAmount * dist;
#endif
texCoord = rotateVec2(texCoord, anim);
#if ELLIPTICAL
texCoord.x /= g_Ratio;
texCoord.xy = rotateVec2(texCoord.xy, -g_Axis);
#endif
texCoord.x /= aspect;
texCoord += g_SpinCenter;
#if REPEAT
texCoord = frac(texCoord);
#endif
texCoord = mix(v_TexCoord.xy, texCoord, feather);
gl_FragColor = texSample2D(g_Texture0, texCoord);
float mask = 1.0;
#if MASK
mask *= texSample2D(g_Texture1, v_TexCoordMask).r;
#endif
gl_FragColor = mix(texSample2D(g_Texture0, v_TexCoord.xy), gl_FragColor, mask);
}

View File

@@ -0,0 +1,34 @@
uniform mat4 g_ModelViewProjectionMatrix;
uniform vec4 g_Texture0Resolution;
uniform vec4 g_Texture1Resolution;
attribute vec3 a_Position;
attribute vec2 a_TexCoord;
varying vec4 v_TexCoord;
#if MASK == 1
varying vec2 v_TexCoordMask;
#endif
uniform float g_Time;
uniform float g_Amount; // {"material":"amount","label":"ui_editor_properties_amount","default":1.0,"range":[0,2.0]}
uniform float g_Speed; // {"material":"speed","label":"ui_editor_properties_speed","default":1.0,"range":[-5,5]}
uniform float g_Phase; // {"material":"phase","label":"ui_editor_properties_time_offset","default":0.0,"range":[0,1]}
void main() {
gl_Position = mul(vec4(a_Position, 1.0), g_ModelViewProjectionMatrix);
v_TexCoord.xy = a_TexCoord.xy;
v_TexCoord.z = g_Texture0Resolution.z / g_Texture0Resolution.w;
v_TexCoord.w = sin(g_Time * g_Speed + g_Phase * 6.28318530718) * g_Amount;
#if MASK == 1
v_TexCoordMask = vec2(a_TexCoord.x * g_Texture1Resolution.z / g_Texture1Resolution.x,
a_TexCoord.y * g_Texture1Resolution.w / g_Texture1Resolution.y);
#endif
}