yes
This commit is contained in:
20
modules/wallpaper-engine/effects/foliagesway/effect.json
Normal file
20
modules/wallpaper-engine/effects/foliagesway/effect.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"version" : 2,
|
||||
"replacementkey" : "foliagesway",
|
||||
"name" : "ui_editor_effect_foliage_sway_title",
|
||||
"description" : "ui_editor_effect_foliage_sway_description",
|
||||
"group" : "animate",
|
||||
"preview" : "preview/project.json",
|
||||
"passes" :
|
||||
[
|
||||
{
|
||||
"material" : "materials/effects/foliagesway.json"
|
||||
}
|
||||
],
|
||||
"dependencies" :
|
||||
[
|
||||
"materials/effects/foliagesway.json",
|
||||
"shaders/effects/foliagesway.frag",
|
||||
"shaders/effects/foliagesway.vert"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"passes": [{
|
||||
"shader": "effects/foliagesway",
|
||||
"blending": "normal",
|
||||
"depthtest": "disabled",
|
||||
"depthwrite": "disabled",
|
||||
"cullmode": "nocull"
|
||||
}]
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name" : "Foliage Sway",
|
||||
"description" : "Sways the object in each corner of the image.",
|
||||
"group" : "geometry",
|
||||
//"preview" : "preview/project.json",
|
||||
"passes" :
|
||||
[
|
||||
{
|
||||
"material" : "materials/effects/foliagesway.json"
|
||||
}
|
||||
],
|
||||
"dependencies" :
|
||||
[
|
||||
"materials/effects/foliagesway.json",
|
||||
"shaders/effects/foliagesway.frag",
|
||||
"shaders/effects/foliagesway.vert"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"passes": [{
|
||||
"shader": "effects/foliagesway",
|
||||
"blending": "normal",
|
||||
"depthtest": "disabled",
|
||||
"depthwrite": "disabled",
|
||||
"cullmode": "nocull"
|
||||
}]
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"passes" :
|
||||
[
|
||||
{
|
||||
"blending" : "translucent",
|
||||
"cullmode" : "nocull",
|
||||
"depthtest" : "disabled",
|
||||
"depthwrite" : "disabled",
|
||||
"shader" : "genericimage2",
|
||||
"textures" : [ "plant1" ]
|
||||
}
|
||||
]
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"clampuvs" : true,
|
||||
"format" : "rgba8888",
|
||||
"nonpoweroftwo" : true
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"passes" :
|
||||
[
|
||||
{
|
||||
"blending" : "translucent",
|
||||
"cullmode" : "nocull",
|
||||
"depthtest" : "disabled",
|
||||
"depthwrite" : "disabled",
|
||||
"shader" : "genericimage2",
|
||||
"textures" : [ "vegetation_grass_card_03" ]
|
||||
}
|
||||
]
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"clampuvs" : true,
|
||||
"format" : "rgba8888",
|
||||
"nonpoweroftwo" : true
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"autosize" : true,
|
||||
"material" : "materials/effectpreview.json"
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"autosize" : true,
|
||||
"material" : "materials/plant1.json"
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"autosize" : true,
|
||||
"material" : "materials/vegetation_grass_card_03.json"
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
114
modules/wallpaper-engine/effects/foliagesway/preview/scene.json
Normal file
114
modules/wallpaper-engine/effects/foliagesway/preview/scene.json
Normal file
@@ -0,0 +1,114 @@
|
||||
{
|
||||
"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.158",
|
||||
"depth" : 1,
|
||||
"effects" :
|
||||
[
|
||||
{
|
||||
"file" : "effects/foliagesway/effect.json",
|
||||
"passes" :
|
||||
[
|
||||
{
|
||||
"constantshadervalues" :
|
||||
{
|
||||
"Power" : 0.75,
|
||||
"Speed" : 3.2100000381469727,
|
||||
"Strength" : 93.339996337890625
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"id" : 35,
|
||||
"image" : "models/plant1.json",
|
||||
"name" : "",
|
||||
"origin" : "90.869 109.808 0.000",
|
||||
"scale" : "0.311 0.311 1.000"
|
||||
},
|
||||
{
|
||||
"angles" : "0.000 0.000 -0.112",
|
||||
"depth" : -1.8400000333786011,
|
||||
"effects" :
|
||||
[
|
||||
{
|
||||
"file" : "effects/foliagesway/effect.json",
|
||||
"passes" :
|
||||
[
|
||||
{
|
||||
"constantshadervalues" :
|
||||
{
|
||||
"Phase" : 3.0999999046325684,
|
||||
"Power" : 0.82999998331069946,
|
||||
"Speed" : 3.869999885559082,
|
||||
"Strength" : 66.680000305175781
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"id" : 43,
|
||||
"image" : "models/plant1.json",
|
||||
"name" : "",
|
||||
"origin" : "187.171 96.043 0.000",
|
||||
"scale" : "-0.187 0.272 1.000"
|
||||
},
|
||||
{
|
||||
"angles" : "0.000 0.000 0.000",
|
||||
"depth" : 1,
|
||||
"effects" :
|
||||
[
|
||||
{
|
||||
"file" : "effects/foliagesway/effect.json",
|
||||
"passes" :
|
||||
[
|
||||
{
|
||||
"constantshadervalues" :
|
||||
{
|
||||
"Phase" : 3.5199999809265137,
|
||||
"Power" : 0.82999998331069946,
|
||||
"Speed" : 2.809999942779541,
|
||||
"Strength" : 33.340000152587891
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"id" : 56,
|
||||
"image" : "models/vegetation_grass_card_03.json",
|
||||
"name" : "",
|
||||
"origin" : "112.015 17.422 0.000",
|
||||
"scale" : "1.000 1.000 1.000"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
|
||||
varying vec2 v_TexCoord;
|
||||
|
||||
uniform sampler2D g_Texture0; // {"material":"Framebuffer","hidden":true}
|
||||
|
||||
void main() {
|
||||
gl_FragColor = texSample2D(g_Texture0, v_TexCoord);
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
|
||||
uniform mat4 g_ModelViewProjectionMatrix;
|
||||
uniform float g_Time;
|
||||
|
||||
uniform float g_Speed; // {"material":"Speed","default":1,"range":[0.01, 10]}
|
||||
uniform float g_Strength; // {"material":"Strength","default":100,"range":[0.01, 500]}
|
||||
uniform float g_Phase; // {"material":"Phase","default":0,"range":[0, 6.28]}
|
||||
uniform float g_Power; // {"material":"Power","default":1,"range":[0.01, 2]}
|
||||
uniform vec2 g_DirectionWeights; // {"material":"Direction weights","default":"1 0.2"}
|
||||
uniform vec4 g_CornerWeights; // {"material":"Corner weights","default":"1 1 0 0"}
|
||||
|
||||
attribute vec3 a_Position;
|
||||
attribute vec2 a_TexCoord;
|
||||
|
||||
varying vec2 v_TexCoord;
|
||||
|
||||
void main() {
|
||||
vec3 position = a_Position;
|
||||
|
||||
vec4 sines = g_Phase + g_Speed * g_Time * vec4(1, -0.16161616, 0.0083333, -0.00019841);
|
||||
sines = sin(sines);
|
||||
vec4 csines = 0.4 + g_Phase + g_Speed * g_Time * vec4(-0.5, 0.041666666, -0.0013888889, 0.000024801587);
|
||||
csines = sin(csines);
|
||||
|
||||
sines = pow(abs(sines), g_Power) * sign(sines);
|
||||
csines = pow(abs(csines), g_Power) * sign(csines);
|
||||
|
||||
float weight = saturate(g_CornerWeights.x * (1.0 - a_TexCoord.x) * (1.0 - a_TexCoord.y) +
|
||||
g_CornerWeights.y * (a_TexCoord.x) * (1.0 - a_TexCoord.y) +
|
||||
g_CornerWeights.z * (a_TexCoord.x) * (a_TexCoord.y) +
|
||||
g_CornerWeights.w * (1.0 - a_TexCoord.x) * (a_TexCoord.y));
|
||||
|
||||
position.x += dot(sines, CAST4(1.0)) * g_Strength * weight * g_DirectionWeights.x;
|
||||
position.y += dot(csines, CAST4(1.0)) * g_Strength * weight * g_DirectionWeights.y;
|
||||
|
||||
|
||||
gl_Position = mul(vec4(position, 1.0), g_ModelViewProjectionMatrix);
|
||||
v_TexCoord = a_TexCoord;
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "FX Preview",
|
||||
"type": "scene2d"
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
|
||||
// [COMBO] {"material":"ui_editor_properties_mode","combo":"MODE","type":"options","default":0,"options":{"Vertex":1,"UV":0}}
|
||||
|
||||
#include "common.h"
|
||||
|
||||
uniform sampler2D g_Texture0; // {"hidden":true}
|
||||
|
||||
#if MODE == 0
|
||||
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"}
|
||||
|
||||
varying vec4 v_TexCoordNoise;
|
||||
varying vec3 v_Params;
|
||||
#endif
|
||||
|
||||
uniform float g_Speed; // {"material":"speeduv","label":"ui_editor_properties_speed","default":5,"range":[0.01, 20]}
|
||||
uniform float g_Power; // {"material":"power","label":"ui_editor_properties_power","default":1,"range":[0.01, 2]}
|
||||
uniform float g_Phase; // {"material":"phase","label":"ui_editor_properties_phase","default":0.5,"range":[0, 2]}
|
||||
|
||||
uniform float g_Time;
|
||||
|
||||
varying vec4 v_TexCoord;
|
||||
|
||||
void main() {
|
||||
#if !MODE
|
||||
vec3 noise = texSample2D(g_Texture2, v_TexCoordNoise.xy).rgb;
|
||||
|
||||
float amp = v_Params.z; //g_Strength * 0.01;
|
||||
#if MASK
|
||||
amp *= texSample2D(g_Texture1, v_TexCoord.zw).r;
|
||||
#endif
|
||||
|
||||
float phase = (noise.g * M_PI * 2 + v_Params.x * 10 + v_Params.y * 5) * g_Phase;
|
||||
vec4 sines = phase + g_Speed * g_Time * vec4(1, -0.16161616, 0.0083333, -0.00019841);
|
||||
sines = sin(sines);
|
||||
vec4 csines = 0.4 + phase + g_Speed * g_Time * vec4(-0.5, 0.041666666, -0.0013888889, 0.000024801587);
|
||||
csines = sin(csines);
|
||||
|
||||
sines = pow(abs(sines), CAST4(g_Power)) * sign(sines);
|
||||
csines = pow(abs(csines), CAST4(g_Power)) * sign(csines);
|
||||
|
||||
|
||||
vec2 texCoordOffset;
|
||||
texCoordOffset.x = v_TexCoordNoise.z * dot(sines, CAST4(amp));
|
||||
texCoordOffset.y = v_TexCoordNoise.w * dot(csines, CAST4(amp));
|
||||
gl_FragColor = texSample2D(g_Texture0, texCoordOffset + v_TexCoord.xy);
|
||||
|
||||
#else
|
||||
gl_FragColor = texSample2D(g_Texture0, v_TexCoord.xy);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
|
||||
#include "common.h"
|
||||
|
||||
uniform mat4 g_ModelViewProjectionMatrix;
|
||||
uniform float g_Time;
|
||||
|
||||
uniform float g_Speed; // {"material":"speed","label":"ui_editor_properties_speed","default":1,"range":[0.01, 10]}
|
||||
uniform float g_Strength; // {"material":"strength","label":"ui_editor_properties_strength","default":0.4,"range":[0.01, 1]}
|
||||
uniform float g_Phase; // {"material":"phase","label":"ui_editor_properties_phase","default":0,"range":[0, 6.28]}
|
||||
uniform float g_Power; // {"material":"power","label":"ui_editor_properties_power","default":1,"range":[0.01, 2]}
|
||||
uniform vec2 g_DirectionWeights; // {"material":"directionweights","label":"ui_editor_properties_direction_weights","default":"1 0.2"}
|
||||
uniform vec4 g_CornerWeights; // {"material":"cornerweights","label":"ui_editor_properties_corner_weights","default":"1 1 0 0"}
|
||||
|
||||
uniform vec2 g_Bounds; // {"material":"bounds","label":"ui_editor_properties_bounds","default":"0 1"}
|
||||
uniform float g_NoiseScale; // {"material":"scale","label":"ui_editor_properties_scale","default":0.05,"range":[0.0, 1.0]}
|
||||
uniform float g_Ratio; // {"material":"ratio","label":"ui_editor_properties_ratio","default":0.3,"range":[0.01,10]}
|
||||
uniform float g_Direction; // {"material":"scrolldirection","label":"ui_editor_properties_direction","default":0,"range":[0,6.28],"direction":true}
|
||||
|
||||
attribute vec3 a_Position;
|
||||
attribute vec2 a_TexCoord;
|
||||
|
||||
#if MODE == 0
|
||||
varying vec4 v_TexCoordNoise;
|
||||
varying vec3 v_Params;
|
||||
uniform vec4 g_Texture0Resolution;
|
||||
#endif
|
||||
|
||||
varying vec4 v_TexCoord;
|
||||
|
||||
#if MASK == 1
|
||||
uniform vec4 g_Texture1Resolution;
|
||||
#endif
|
||||
|
||||
void main() {
|
||||
v_TexCoord.zw = CAST2(0.0);
|
||||
|
||||
#if MODE == 0
|
||||
gl_Position = mul(vec4(a_Position, 1.0), g_ModelViewProjectionMatrix);
|
||||
#if MASK == 1
|
||||
v_TexCoord.zw = vec2(a_TexCoord.x * g_Texture1Resolution.z / g_Texture1Resolution.x,
|
||||
a_TexCoord.y * g_Texture1Resolution.w / g_Texture1Resolution.y);
|
||||
#endif
|
||||
|
||||
float aspect = g_Texture0Resolution.z / g_Texture0Resolution.w * g_Ratio;
|
||||
v_TexCoordNoise.zw = rotateVec2(vec2(1.0 / aspect, aspect), g_Direction);
|
||||
v_TexCoordNoise.xy = a_TexCoord.xy * g_NoiseScale; // rotateVec2(vec2(a_TexCoord.x, -a_TexCoord.y), g_Direction);
|
||||
//v_TexCoordNoise = vec2(v_TexCoordNoise.x * aspect * g_Ratio, v_TexCoordNoise.y) * g_NoiseScale;
|
||||
|
||||
v_Params.xy = rotateVec2(a_TexCoord.xy, g_Direction);
|
||||
v_Params.z = g_Strength * g_Strength * 0.005;
|
||||
#else
|
||||
vec3 position = a_Position;
|
||||
|
||||
vec4 sines = g_Phase + g_Speed * g_Time * vec4(1, -0.16161616, 0.0083333, -0.00019841);
|
||||
sines = sin(sines);
|
||||
vec4 csines = 0.4 + g_Phase + g_Speed * g_Time * vec4(-0.5, 0.041666666, -0.0013888889, 0.000024801587);
|
||||
csines = sin(csines);
|
||||
|
||||
sines = pow(abs(sines), CAST4(g_Power)) * sign(sines);
|
||||
csines = pow(abs(csines), CAST4(g_Power)) * sign(csines);
|
||||
|
||||
float weight = saturate(g_CornerWeights.x * (1.0 - a_TexCoord.x) * (1.0 - a_TexCoord.y) +
|
||||
g_CornerWeights.y * (a_TexCoord.x) * (1.0 - a_TexCoord.y) +
|
||||
g_CornerWeights.z * (a_TexCoord.x) * (a_TexCoord.y) +
|
||||
g_CornerWeights.w * (1.0 - a_TexCoord.x) * (a_TexCoord.y));
|
||||
|
||||
position.x += dot(sines, CAST4(1.0)) * g_Strength * 100.0 * weight * g_DirectionWeights.x;
|
||||
position.y += dot(csines, CAST4(1.0)) * g_Strength * 100.0 * weight * g_DirectionWeights.y;
|
||||
|
||||
gl_Position = mul(vec4(position, 1.0), g_ModelViewProjectionMatrix);
|
||||
#endif
|
||||
v_TexCoord.xy = a_TexCoord;
|
||||
}
|
||||
Reference in New Issue
Block a user