yes
This commit is contained in:
20
modules/wallpaper-engine/effects/nitro/effect.json
Normal file
20
modules/wallpaper-engine/effects/nitro/effect.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"version" : 1,
|
||||
"replacementkey" : "nitro",
|
||||
"name" : "ui_editor_effect_nitro_title",
|
||||
"description" : "ui_editor_effect_nitro_description",
|
||||
"group" : "colorize",
|
||||
"preview" : "preview/project.json",
|
||||
"passes" :
|
||||
[
|
||||
{
|
||||
"material" : "materials/effects/nitro.json"
|
||||
}
|
||||
],
|
||||
"dependencies" :
|
||||
[
|
||||
"materials/effects/nitro.json",
|
||||
"shaders/effects/nitro.frag",
|
||||
"shaders/effects/nitro.vert"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"passes": [{
|
||||
"shader": "effects/nitro",
|
||||
"blending": "normal",
|
||||
"depthtest": "disabled",
|
||||
"depthwrite": "disabled",
|
||||
"cullmode": "nocull"
|
||||
}]
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name" : "ui_editor_effect_nitro_title",
|
||||
"description" : "ui_editor_effect_nitro_description",
|
||||
"group" : "colorize",
|
||||
//"preview" : "preview/project.json",
|
||||
"passes" :
|
||||
[
|
||||
{
|
||||
"material" : "materials/effects/nitro.json"
|
||||
}
|
||||
],
|
||||
"dependencies" :
|
||||
[
|
||||
"materials/effects/nitro.json",
|
||||
"shaders/effects/nitro.frag",
|
||||
"shaders/effects/nitro.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/nitro",
|
||||
"blending": "normal",
|
||||
"depthtest": "disabled",
|
||||
"depthwrite": "disabled",
|
||||
"cullmode": "nocull"
|
||||
}]
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"autosize" : true,
|
||||
"material" : "materials/effectpreview.json"
|
||||
}
|
||||
18
modules/wallpaper-engine/effects/nitro/preview/project.json
Normal file
18
modules/wallpaper-engine/effects/nitro/preview/project.json
Normal 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"
|
||||
}
|
||||
67
modules/wallpaper-engine/effects/nitro/preview/scene.json
Normal file
67
modules/wallpaper-engine/effects/nitro/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",
|
||||
"colorBlendMode" : 0,
|
||||
"copybackground" : true,
|
||||
"depth" : 1,
|
||||
"effects" :
|
||||
[
|
||||
{
|
||||
"file" : "effects/nitro/effect.json",
|
||||
"passes" :
|
||||
[
|
||||
{
|
||||
"constantshadervalues" :
|
||||
{
|
||||
"ui_editor_properties_bounds" : "0.3 0.2",
|
||||
"ui_editor_properties_color_end" : "1 1 1",
|
||||
"ui_editor_properties_color_start" : "0 1 1",
|
||||
"ui_editor_properties_multiply" : 3
|
||||
},
|
||||
"textures" : [ null, "util/clouds_256" ]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"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,46 @@
|
||||
|
||||
// [COMBO] {"material":"ui_editor_properties_blend_mode","combo":"BLENDMODE","type":"imageblending","default":22}
|
||||
// [COMBO] {"material":"ui_editor_properties_write_alpha","combo":"WRITEALPHA","type":"options","default":0}
|
||||
|
||||
#include "common.h"
|
||||
#include "common_blending.h"
|
||||
|
||||
varying vec4 v_TexCoord;
|
||||
varying vec4 v_TexCoordNitro;
|
||||
|
||||
uniform sampler2D g_Texture0; // {"material":"ui_editor_properties_framebuffer","hidden":true}
|
||||
uniform sampler2D g_Texture1; // {"material":"ui_editor_properties_albedo","default":"util/clouds_256"}
|
||||
uniform sampler2D g_Texture2; // {"material":"ui_editor_properties_opacity_mask","mode":"opacitymask","default":"util/white","combo":"MASK"}
|
||||
|
||||
uniform float g_NitroAlpha; // {"material":"ui_editor_properties_multiply","default":1.0,"range":[0.01, 10]}
|
||||
uniform vec3 g_NitroColor0; // {"material":"ui_editor_properties_color_start","default":"0 1 1","type":"color"}
|
||||
uniform vec3 g_NitroColor1; // {"material":"ui_editor_properties_color_end","default":"1 1 1","type":"color"}
|
||||
uniform vec2 g_NitroRanges; // {"material":"ui_editor_properties_bounds","default":"0.3 0.25"}
|
||||
|
||||
|
||||
void main() {
|
||||
vec4 albedo = texSample2D(g_Texture0, v_TexCoord.xy);
|
||||
float nitro0 = texSample2D(g_Texture1, v_TexCoordNitro.xy).r;
|
||||
float nitro1 = texSample2D(g_Texture1, v_TexCoordNitro.zw).r;
|
||||
float remap = texSample2D(g_Texture1, v_TexCoord.xy).r;
|
||||
|
||||
vec2 noiseBase = g_NitroRanges;
|
||||
float coreNoise = smoothstep(nitro0, nitro1, 0.1 + remap * 0.8);
|
||||
float nitro = smoothstep(noiseBase.y, noiseBase.x, nitro0 * nitro1) * smoothstep(noiseBase.x, noiseBase.y, nitro0 * nitro1);
|
||||
nitro = coreNoise * nitro * 4;
|
||||
|
||||
vec3 nitroColor = mix(g_NitroColor0, g_NitroColor1, nitro);
|
||||
|
||||
float blend = nitro * g_NitroAlpha;
|
||||
#if MASK == 1
|
||||
blend *= texSample2D(g_Texture2, v_TexCoord.zw).r;
|
||||
#endif
|
||||
|
||||
albedo.rgb = ApplyBlending(BLENDMODE, albedo.rgb, nitroColor, blend);
|
||||
|
||||
#if WRITEALPHA == 1
|
||||
albedo.a = blend;
|
||||
#endif
|
||||
|
||||
gl_FragColor = albedo;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
|
||||
uniform mat4 g_ModelViewProjectionMatrix;
|
||||
uniform vec4 g_Texture0Resolution;
|
||||
|
||||
#if MASK == 1
|
||||
uniform vec4 g_Texture2Resolution;
|
||||
#endif
|
||||
|
||||
uniform float g_Time;
|
||||
uniform vec4 g_NitroSpeeds; // {"material":"ui_editor_properties_speed","default":"-0.1 0.7 0.1 0"}
|
||||
uniform vec2 g_NitroScales; // {"material":"ui_editor_properties_scale","default":"1 2"}
|
||||
|
||||
attribute vec3 a_Position;
|
||||
attribute vec2 a_TexCoord;
|
||||
|
||||
varying vec4 v_TexCoord;
|
||||
varying vec4 v_TexCoordNitro;
|
||||
|
||||
void main() {
|
||||
gl_Position = mul(vec4(a_Position, 1.0), g_ModelViewProjectionMatrix);
|
||||
v_TexCoord = a_TexCoord.xyxy;
|
||||
|
||||
float aspect = g_Texture0Resolution.z / g_Texture0Resolution.w;
|
||||
v_TexCoordNitro.xy = (a_TexCoord + g_Time * g_NitroSpeeds.xy) * g_NitroScales.x;
|
||||
v_TexCoordNitro.zw = (a_TexCoord + g_Time * g_NitroSpeeds.zw) * g_NitroScales.y;
|
||||
|
||||
v_TexCoordNitro.xz *= aspect;
|
||||
|
||||
v_TexCoordNitro.zw = vec2(-v_TexCoordNitro.w, v_TexCoordNitro.z);
|
||||
|
||||
#if MASK == 1
|
||||
v_TexCoord.zw = vec2(v_TexCoord.x * g_Texture2Resolution.z / g_Texture2Resolution.x,
|
||||
v_TexCoord.y * g_Texture2Resolution.w / g_Texture2Resolution.y);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "FX Preview",
|
||||
"type": "scene2d"
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
|
||||
// [COMBO] {"material":"ui_editor_properties_blend_mode","combo":"BLENDMODE","type":"imageblending","default":22}
|
||||
// [COMBO] {"material":"ui_editor_properties_write_alpha","combo":"WRITEALPHA","type":"options","default":0}
|
||||
|
||||
#include "common.h"
|
||||
#include "common_blending.h"
|
||||
|
||||
varying vec4 v_TexCoord;
|
||||
varying vec4 v_TexCoordNitro;
|
||||
|
||||
uniform sampler2D g_Texture0; // {"hidden":true}
|
||||
uniform sampler2D g_Texture1; // {"label":"ui_editor_properties_albedo","default":"util/clouds_256"}
|
||||
uniform sampler2D g_Texture2; // {"label":"ui_editor_properties_opacity_mask","mode":"opacitymask","combo":"MASK","paintdefaultcolor":"0 0 0 1"}
|
||||
|
||||
uniform float g_NitroAlpha; // {"material":"multiply","label":"ui_editor_properties_multiply","default":1.0,"range":[0.01, 10]}
|
||||
uniform vec3 g_NitroColor0; // {"material":"colorstart","label":"ui_editor_properties_color_start","default":"0 0.5 1","type":"color"}
|
||||
uniform vec3 g_NitroColor1; // {"material":"colorend","label":"ui_editor_properties_color_end","default":"1 1 1","type":"color"}
|
||||
uniform vec2 g_NitroRanges; // {"material":"bounds","label":"ui_editor_properties_bounds","default":"0.3 0.25"}
|
||||
uniform float g_NitroLOD; // {"material":"smoothness","label":"ui_editor_properties_smoothness","default":1,"range":[0.0, 5]}
|
||||
|
||||
|
||||
void main() {
|
||||
vec4 albedo = texSample2D(g_Texture0, v_TexCoord.xy);
|
||||
float nitro0 = texSample2DLod(g_Texture1, v_TexCoordNitro.xy, g_NitroLOD).r;
|
||||
float nitro1 = texSample2DLod(g_Texture1, v_TexCoordNitro.zw, g_NitroLOD).r;
|
||||
float remap = texSample2D(g_Texture1, v_TexCoord.xy).r;
|
||||
|
||||
vec2 noiseBase = g_NitroRanges;
|
||||
float coreNoise = smoothstep(nitro0, nitro1, 0.1 + remap * 0.8);
|
||||
float nitro = smoothstep(noiseBase.y, noiseBase.x, nitro0 * nitro1) * smoothstep(noiseBase.x, noiseBase.y, nitro0 * nitro1);
|
||||
nitro = coreNoise * nitro * 4;
|
||||
|
||||
vec3 nitroColor = mix(g_NitroColor0, g_NitroColor1, nitro);
|
||||
|
||||
float blend = nitro * g_NitroAlpha;
|
||||
#if MASK
|
||||
blend *= texSample2D(g_Texture2, v_TexCoord.zw).r;
|
||||
#endif
|
||||
|
||||
albedo.rgb = ApplyBlending(BLENDMODE, albedo.rgb, nitroColor, blend);
|
||||
|
||||
#if WRITEALPHA
|
||||
albedo.a = blend;
|
||||
#endif
|
||||
|
||||
gl_FragColor = vec4(max(0, albedo.rgb), albedo.a);
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
|
||||
uniform mat4 g_ModelViewProjectionMatrix;
|
||||
uniform vec4 g_Texture0Resolution;
|
||||
|
||||
#if MASK == 1
|
||||
uniform vec4 g_Texture2Resolution;
|
||||
#endif
|
||||
|
||||
uniform float g_Time;
|
||||
uniform vec4 g_NitroSpeeds; // {"material":"speed","label":"ui_editor_properties_speed","default":"-0.1 0.7 0.1 -0.5"}
|
||||
uniform vec2 g_NitroScales; // {"material":"scale","label":"ui_editor_properties_scale","default":"1 2"}
|
||||
|
||||
attribute vec3 a_Position;
|
||||
attribute vec2 a_TexCoord;
|
||||
|
||||
varying vec4 v_TexCoord;
|
||||
varying vec4 v_TexCoordNitro;
|
||||
|
||||
void main() {
|
||||
gl_Position = mul(vec4(a_Position, 1.0), g_ModelViewProjectionMatrix);
|
||||
v_TexCoord = a_TexCoord.xyxy;
|
||||
|
||||
float aspect = g_Texture0Resolution.z / g_Texture0Resolution.w;
|
||||
v_TexCoordNitro.xy = (a_TexCoord * g_NitroScales.x + g_Time * g_NitroSpeeds.xy);
|
||||
v_TexCoordNitro.zw = (a_TexCoord * g_NitroScales.y + g_Time * g_NitroSpeeds.zw);
|
||||
|
||||
v_TexCoordNitro.xz *= aspect;
|
||||
|
||||
v_TexCoordNitro.zw = vec2(-v_TexCoordNitro.w, v_TexCoordNitro.z);
|
||||
|
||||
#if MASK == 1
|
||||
v_TexCoord.zw = vec2(v_TexCoord.x * g_Texture2Resolution.z / g_Texture2Resolution.x,
|
||||
v_TexCoord.y * g_Texture2Resolution.w / g_Texture2Resolution.y);
|
||||
#endif
|
||||
}
|
||||
Reference in New Issue
Block a user