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

View File

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

View File

@@ -0,0 +1,20 @@
{
"version" : 1,
"replacementkey" : "iris",
"name" : "ui_editor_effect_iris_title",
"description" : "ui_editor_effect_iris_description",
"group" : "animate",
"preview" : "preview/project.json",
"passes" :
[
{
"material" : "materials/effects/iris.json"
}
],
"dependencies" :
[
"materials/effects/iris.json",
"shaders/effects/iris.frag",
"shaders/effects/iris.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,9 @@
{
"passes": [{
"shader": "effects/iris",
"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,17 @@
{
"file" : "scene.json",
"general" :
{
"properties" :
{
"schemecolor" :
{
"order" : 0,
"text" : "ui_browse_properties_scheme_color",
"type" : "color",
"value" : "0 0 0"
}
}
},
"title" : "preview"
}

View File

@@ -0,0 +1,88 @@
{
"camera" :
{
"center" : "-5.30420 -15.61792 -1.00000",
"eye" : "-5.30420 -15.61792 0.00000",
"up" : "0.00000 1.00000 0.00000"
},
"general" :
{
"ambientcolor" : "0.30000 0.30000 0.30000",
"bloom" : false,
"bloomhdrfeather" : 0.10000000149011612,
"bloomhdrscatter" : 1.6189999580383301,
"bloomhdrstrength" : 2.0,
"bloomhdrthreshold" : 1.0,
"bloomstrength" : 2.0,
"bloomthreshold" : 0.64999997615814209,
"camerafade" : true,
"cameraparallax" : false,
"cameraparallaxamount" : 0.5,
"cameraparallaxdelay" : 0.10000000149011612,
"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.0099999997764825821,
"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/iris/effect.json",
"id" : 18,
"name" : "",
"passes" :
[
{
"constantshadervalues" :
{
"scale" : "20 20"
},
"id" : 19,
"textures" : [ null, "masks/iris_mask_ee0d9bbc6d0516b8583c8fb3e841485c0b7ec4e8" ]
}
],
"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,24 @@
varying vec4 v_TexCoord;
varying vec4 v_TexCoordIris;
uniform sampler2D g_Texture0; // {"material":"framebuffer", "label":"ui_editor_properties_framebuffer", "hidden":true}
uniform sampler2D g_Texture1; // {"material":"mask", "label":"ui_editor_properties_opacity_mask","mode":"opacitymask","default":"util/white","combo":"MASK","paintdefaultcolor":"0 0 0 1"}
uniform vec3 g_EyeColor; // {"material":"color", "label":"ui_editor_properties_background_color", "type": "color", "default":"1 1 1"}
void main() {
vec4 albedo = texSample2D(g_Texture0, v_TexCoord.xy);
vec4 iris = texSample2D(g_Texture0, v_TexCoordIris.xy);
float mask = 1.0; //g_BlendAlpha;
#if MASK
mask *= texSample2D(g_Texture1, v_TexCoord.zw).r;
float irisMask = texSample2D(g_Texture1, v_TexCoordIris.zw).r;
iris.rgb = mix(g_EyeColor, iris.rgb, irisMask);
#endif
albedo = mix(albedo, iris, mask);
gl_FragColor = albedo;
}

View File

@@ -0,0 +1,40 @@
uniform mat4 g_ModelViewProjectionMatrix;
uniform float g_Time;
uniform vec2 g_Scale; // {"material":"scale","label":"ui_editor_properties_scale","default":"1 1","linked":true,"range":[0.01, 10.0]}
uniform float g_Speed; // {"material":"speed","label":"ui_editor_properties_speed","default":1,"range":[0.01, 2.0]}
uniform float g_Rough; // {"material":"rough","label":"ui_editor_properties_smoothness","default":0.2,"range":[0.01, 1.0]}
uniform float g_NoiseAmount; // {"material":"noiseamount","label":"ui_editor_properties_noise_amount","default":0.5,"range":[0.01, 2.0]}
#if MASK
uniform vec4 g_Texture1Resolution;
#endif
attribute vec3 a_Position;
attribute vec2 a_TexCoord;
varying vec4 v_TexCoord;
varying vec4 v_TexCoordIris;
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
float dt = floor(g_Time * g_Speed);
float ft = frac(g_Time * g_Speed);
vec2 da0 = sin(1.7 * dt) + sin(2.3 * dt + vec2(1.0, 2.0));
vec2 da1 = sin(1.7 * (dt + 1.0)) + sin(2.3 * (dt + 1.0) + vec2(1.0, 2.0));
vec2 da = mix(da0, da1, smoothstep(1.0 - g_Rough, 1.0, ft));
da.x += sin(g_Time * g_Speed) * g_NoiseAmount;
da.y += cos(g_Time * g_Speed) * g_NoiseAmount;
da *= g_Scale * 0.001;
v_TexCoordIris = v_TexCoord + da.xyxy;
}

View File

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

View File

@@ -0,0 +1,31 @@
// [COMBO] {"material":"ui_editor_properties_background","combo":"BACKGROUND","type":"options","default":0}
varying vec4 v_TexCoord;
varying vec2 v_TexCoordIris;
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 vec3 g_EyeColor; // {"material":"color", "label":"ui_editor_properties_background_color", "type": "color", "default":"1 1 1"}
void main() {
vec4 albedo = texSample2D(g_Texture0, v_TexCoord.xy);
float mask = 1.0;
#if MASK
mask *= texSample2D(g_Texture1, v_TexCoord.zw).r;
vec4 iris = texSample2D(g_Texture0, v_TexCoord.xy + v_TexCoordIris.xy * mask);
float irisMask = texSample2D(g_Texture1, v_TexCoord.zw + v_TexCoordIris.xy * mask).r;
#if BACKGROUND
iris.rgb = mix(g_EyeColor, iris.rgb, irisMask);
#endif
#else
vec4 iris = texSample2D(g_Texture0, v_TexCoord.xy + v_TexCoordIris.xy);
#endif
//albedo = mix(albedo, iris, mask);
albedo = iris;
gl_FragColor = albedo;
}

View File

@@ -0,0 +1,45 @@
#include "common.h"
uniform mat4 g_ModelViewProjectionMatrix;
uniform float g_Time;
uniform vec2 g_Scale; // {"material":"scale","label":"ui_editor_properties_scale","default":"1 1","linked":true,"range":[0.01, 10.0]}
uniform float g_Speed; // {"material":"speed","label":"ui_editor_properties_speed","default":1,"range":[0.01, 2.0]}
uniform float g_Rough; // {"material":"rough","label":"ui_editor_properties_smoothness","default":0.2,"range":[0.01, 1.0]}
uniform float g_NoiseAmount; // {"material":"noiseamount","label":"ui_editor_properties_noise_amount","default":0.5,"range":[0.01, 2.0]}
uniform float g_PhaseOffset; // {"material":"phase", "label":"ui_editor_properties_phase", "default":0,"range":[-1, 1]}
#if MASK
uniform vec4 g_Texture1Resolution;
#endif
attribute vec3 a_Position;
attribute vec2 a_TexCoord;
varying vec4 v_TexCoord;
varying vec2 v_TexCoordIris;
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
float time = (g_Time * g_Speed) + g_PhaseOffset;
float lowDt = floor(time);
vec2 motion2 = sin(1.9 * (lowDt + vec2(0, 1)));
vec4 motion4 = sin(2.5 * (lowDt + vec4(0, 0, 1, 1)) + vec4(1, 2, 1, 2));
vec2 moveStart = motion2.xx + motion4.xy;
vec2 moveEnd = motion2.yy + motion4.zw;
vec2 da = mix(moveStart, moveEnd, smoothstep(1 - g_Rough, 1, cos(frac(time) * M_PI) * -0.5 + 0.5));
da.x += sin(time) * g_NoiseAmount;
da.y += cos(time) * g_NoiseAmount;
da *= g_Scale * 0.001;
v_TexCoordIris = da.xy;
}