stuff
This commit is contained in:
33
modules/wallpaper-engine/effects/spin/effect.json
Normal file
33
modules/wallpaper-engine/effects/spin/effect.json
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"version" : 2,
|
||||
"replacementkey" : "spin",
|
||||
"name" : "ui_editor_effect_spin_title",
|
||||
"description" : "ui_editor_effect_spin_description",
|
||||
"group" : "animate",
|
||||
"preview" : "preview/project.json",
|
||||
"passes" :
|
||||
[
|
||||
{
|
||||
"material" : "materials/effects/spin.json"
|
||||
}
|
||||
],
|
||||
"dependencies" :
|
||||
[
|
||||
"materials/effects/spin.json",
|
||||
"shaders/effects/spin.frag",
|
||||
"shaders/effects/spin.vert"
|
||||
],
|
||||
"gizmos" :
|
||||
[
|
||||
{
|
||||
"type" : "EffectSpinUV",
|
||||
"vars" :
|
||||
{
|
||||
"center" : "center",
|
||||
"ratio" : "ratio",
|
||||
"angle" : "angle",
|
||||
"size" : "size"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"passes": [{
|
||||
"shader": "effects/spin",
|
||||
"blending": "normal",
|
||||
"depthtest": "disabled",
|
||||
"depthwrite": "disabled",
|
||||
"cullmode": "nocull"
|
||||
}]
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name" : "Spin",
|
||||
"description" : "Spin the image.",
|
||||
"group" : "image",
|
||||
"preview" : "preview/project.json",
|
||||
"passes" :
|
||||
[
|
||||
{
|
||||
"material" : "materials/effects/spin.json"
|
||||
}
|
||||
],
|
||||
"dependencies" :
|
||||
[
|
||||
"materials/effects/spin.json",
|
||||
"shaders/effects/spin.frag",
|
||||
"shaders/effects/spin.vert"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"passes" :
|
||||
[
|
||||
{
|
||||
"blending" : "translucent",
|
||||
"cullmode" : "nocull",
|
||||
"depthtest" : "disabled",
|
||||
"depthwrite" : "disabled",
|
||||
"shader" : "genericimage2",
|
||||
"textures" : [ "effectpreview" ]
|
||||
}
|
||||
]
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"clampuvs" : true,
|
||||
"format" : "rgba8888",
|
||||
"nomip" : true,
|
||||
"nonpoweroftwo" : true
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"passes": [{
|
||||
"shader": "effects/spin",
|
||||
"blending": "normal",
|
||||
"depthtest": "disabled",
|
||||
"depthwrite": "disabled",
|
||||
"cullmode": "nocull"
|
||||
}]
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"clampuvs" : true,
|
||||
"format" : "rgba8888",
|
||||
"nomip" : true,
|
||||
"nonpoweroftwo" : true
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"autosize" : true,
|
||||
"material" : "materials/effectpreview.json"
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"file" : "scene.json",
|
||||
"title" : "previews"
|
||||
}
|
||||
67
modules/wallpaper-engine/effects/spin/preview/scene.json
Normal file
67
modules/wallpaper-engine/effects/spin/preview/scene.json
Normal file
@@ -0,0 +1,67 @@
|
||||
{
|
||||
"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",
|
||||
"depth" : 1,
|
||||
"effects" :
|
||||
[
|
||||
{
|
||||
"file" : "effects/spin/effect.json",
|
||||
"passes" :
|
||||
[
|
||||
{
|
||||
"combos" :
|
||||
{
|
||||
"CLAMP" : 1,
|
||||
"MODE" : 0
|
||||
},
|
||||
"constantshadervalues" :
|
||||
{
|
||||
"Center" : "0.501 0.47"
|
||||
},
|
||||
"textures" : [ null, "masks/spin_mask_ee0d9bbc6d0516b8583c8fb3e841485c0b7ec4e8" ]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
|
||||
// [COMBO] {"material":"Repeat","combo":"CLAMP","type":"options","default":1}
|
||||
|
||||
varying vec4 v_TexCoord;
|
||||
varying vec2 v_TexCoordMask;
|
||||
|
||||
uniform sampler2D g_Texture0; // {"material":"Framebuffer","hidden":true}
|
||||
|
||||
#if MASK == 1
|
||||
uniform sampler2D g_Texture1; // {"material":"Mask","mode":"opacitymask","combo":"MASK","default":"util/black"}
|
||||
#endif
|
||||
|
||||
void main() {
|
||||
vec2 texCoord = v_TexCoord.xy;
|
||||
#if CLAMP
|
||||
texCoord = frac(texCoord);
|
||||
#endif
|
||||
gl_FragColor = texSample2D(g_Texture0, texCoord);
|
||||
|
||||
#if MASK == 1
|
||||
float mask = texSample2D(g_Texture1, v_TexCoordMask).r;
|
||||
gl_FragColor = mix(texSample2D(g_Texture0, v_TexCoord.zw), gl_FragColor, mask);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
|
||||
// [COMBO] {"material":"Mode","combo":"MODE","type":"options","default":0,"options":{"Vertex":1,"UV":0}}
|
||||
|
||||
#include "common.h"
|
||||
|
||||
uniform mat4 g_ModelViewProjectionMatrix;
|
||||
uniform float g_Time;
|
||||
uniform vec4 g_Texture1Resolution;
|
||||
|
||||
uniform float g_Speed; // {"material":"Speed","default":1.0,"range":[-5,5]}
|
||||
uniform vec2 g_SpinCenter; // {"material":"Center","default":"0.5 0.5"}
|
||||
|
||||
attribute vec3 a_Position;
|
||||
attribute vec2 a_TexCoord;
|
||||
|
||||
varying vec4 v_TexCoord;
|
||||
|
||||
#if MASK == 1
|
||||
varying vec2 v_TexCoordMask;
|
||||
#endif
|
||||
|
||||
void main() {
|
||||
|
||||
vec3 position = a_Position;
|
||||
#if MODE == 1
|
||||
position.xy = rotateVec2(position.xy - g_SpinCenter, g_Speed * g_Time) + g_SpinCenter;
|
||||
#endif
|
||||
gl_Position = mul(vec4(position, 1.0), g_ModelViewProjectionMatrix);
|
||||
|
||||
v_TexCoord.xyzw = a_TexCoord.xyxy;
|
||||
|
||||
#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
|
||||
|
||||
#if MODE == 0
|
||||
v_TexCoord.xy = rotateVec2(v_TexCoord.xy - g_SpinCenter, g_Speed * g_Time) + g_SpinCenter;
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "FX Preview",
|
||||
"type": "scene2d"
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
|
||||
// [COMBO] {"material":"ui_editor_properties_repeat","combo":"REPEAT","type":"options","default":1}
|
||||
|
||||
varying vec4 v_TexCoord;
|
||||
varying vec2 v_TexCoordMask;
|
||||
varying vec2 v_TexCoordSoftMask;
|
||||
|
||||
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 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.1,"range":[0,1]}
|
||||
uniform float g_Feather; // {"material":"feather","label":"ui_editor_properties_feather","default":0.002,"range":[0,0.2]}
|
||||
|
||||
void main() {
|
||||
vec2 texCoord = v_TexCoord.xy;
|
||||
|
||||
#if REPEAT
|
||||
texCoord = frac(texCoord);
|
||||
#endif
|
||||
gl_FragColor = texSample2D(g_Texture0, texCoord);
|
||||
|
||||
vec2 maskDelta = v_TexCoordSoftMask.xy - g_SpinCenter;
|
||||
float mask = smoothstep(g_Size + g_Feather + 0.00001, g_Size - g_Feather, length(maskDelta));
|
||||
|
||||
#if MASK
|
||||
mask *= texSample2D(g_Texture1, v_TexCoordMask).r;
|
||||
#endif
|
||||
|
||||
gl_FragColor = mix(texSample2D(g_Texture0, v_TexCoord.zw), gl_FragColor, mask);
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
|
||||
// [COMBO] {"material":"ui_editor_properties_elliptical","combo":"ELLIPTICAL","type":"options","default":1}
|
||||
// [COMBO] {"material":"ui_editor_properties_noise","combo":"NOISE","type":"options","default":0}
|
||||
|
||||
#include "common.h"
|
||||
|
||||
uniform mat4 g_ModelViewProjectionMatrix;
|
||||
uniform float g_Time;
|
||||
uniform vec4 g_Texture0Resolution;
|
||||
uniform vec4 g_Texture1Resolution;
|
||||
|
||||
uniform float g_Speed; // {"material":"speed","label":"ui_editor_properties_speed","default":1.0,"range":[-5,5]}
|
||||
uniform vec2 g_SpinCenter; // {"material":"center","label":"ui_editor_properties_center","default":"0.5 0.5","position":true}
|
||||
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_Phase; // {"material":"phase","label":"ui_editor_properties_time_offset","default":0.0,"range":[0,1]}
|
||||
|
||||
uniform vec2 g_Friction; // {"material":"friction","label":"ui_editor_properties_friction","default":"1 1","linked":true,"range":[0.01, 10.0]}
|
||||
uniform float g_NoiseSpeed; // {"material":"noisespeed","label":"ui_editor_properties_noise_speed","default":5,"range":[-10,10]}
|
||||
uniform float g_NoiseAmount; // {"material":"noiseamount","label":"ui_editor_properties_noise_amount","default":1,"range":[0,5]}
|
||||
|
||||
attribute vec3 a_Position;
|
||||
attribute vec2 a_TexCoord;
|
||||
|
||||
varying vec4 v_TexCoord;
|
||||
varying vec2 v_TexCoordSoftMask;
|
||||
|
||||
#if MASK == 1
|
||||
varying vec2 v_TexCoordMask;
|
||||
#endif
|
||||
|
||||
void main() {
|
||||
|
||||
float aspect = g_Texture0Resolution.z / g_Texture0Resolution.w;
|
||||
vec3 position = a_Position;
|
||||
|
||||
gl_Position = mul(vec4(position, 1.0), g_ModelViewProjectionMatrix);
|
||||
|
||||
v_TexCoord.xyzw = a_TexCoord.xyxy;
|
||||
|
||||
#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
|
||||
|
||||
v_TexCoord.xy -= g_SpinCenter;
|
||||
v_TexCoord.x *= aspect;
|
||||
|
||||
#if ELLIPTICAL
|
||||
v_TexCoord.xy = rotateVec2(v_TexCoord.xy, g_Axis);
|
||||
v_TexCoord.x *= g_Ratio;
|
||||
#endif
|
||||
v_TexCoordSoftMask.xy = v_TexCoord.xy;
|
||||
|
||||
float offset = g_Phase * 6.28318530718;
|
||||
#if NOISE
|
||||
vec4 sines = frac(g_NoiseSpeed * g_Time / M_PI_2 * vec4(1, -0.16161616, 0.0083333, -0.00019841)) * M_PI_2;
|
||||
vec4 csines = cos(sines);
|
||||
sines = sin(sines);
|
||||
|
||||
vec4 base = step(0.0, csines);
|
||||
sines = sines * 0.498 + 0.5;
|
||||
sines = mix(1.0 - pow(1.0 - sines, CAST4(g_Friction.x)), pow(sines, CAST4(g_Friction.y)), base);
|
||||
offset += (dot(CAST4(0.5), sines) - 1.0) * g_NoiseAmount;
|
||||
#endif
|
||||
|
||||
v_TexCoord.xy = rotateVec2(v_TexCoord.xy, g_Speed * g_Time + offset);
|
||||
|
||||
#if ELLIPTICAL
|
||||
v_TexCoord.x /= g_Ratio;
|
||||
v_TexCoord.xy = rotateVec2(v_TexCoord.xy, -g_Axis);
|
||||
|
||||
v_TexCoordSoftMask.xy = rotateVec2(v_TexCoordSoftMask.xy, -g_Axis);
|
||||
#endif
|
||||
|
||||
v_TexCoord.x /= aspect;
|
||||
v_TexCoord.xy += g_SpinCenter;
|
||||
|
||||
v_TexCoordSoftMask.xy += g_SpinCenter;
|
||||
}
|
||||
Reference in New Issue
Block a user