This commit is contained in:
2025-04-29 13:39:02 -05:00
commit 9cbb583982
2257 changed files with 77258 additions and 0 deletions

View File

@@ -0,0 +1,62 @@
{
"name" : "Motion Blur",
"description" : "Accumulates the image over time to create a motion blur effect.",
"group" : "composite",
//"preview" : "preview/project.json",
"passes" :
[
{
"material" : "materials/effects/motionblur_accumulation.json",
"target" : "_rt_FullCompoBuffer2",
"bind" :
[
{
"name" : "previous",
"index" : 0
},
{
"name" : "_rt_FullCompoBuffer1",
"index" : 1
}
]
},
{
"command" : "copy",
"target" : "_rt_FullCompoBuffer1",
"source" : "_rt_FullCompoBuffer2"
},
{
"material" : "materials/effects/motionblur_combine.json",
"bind" :
[
{
"name" : "_rt_FullCompoBuffer2",
"index" : 0
}
]
}
],
"fbos" :
[
{
"name" : "_rt_FullCompoBuffer1",
"scale" : 1,
"format" : "rgba8888",
"unique" : true
},
{
"name" : "_rt_FullCompoBuffer2",
"scale" : 1,
"format" : "rgba8888"
}
],
"dependencies" :
[
"materials/effects/motionblur_accumulation.json",
"materials/effects/motionblur_combine.json",
"shaders/effects/motionblur_accumulation.frag",
"shaders/effects/motionblur_accumulation.vert",
"shaders/effects/motionblur_combine.frag",
"shaders/effects/motionblur_combine.vert"
]
}

View File

@@ -0,0 +1,18 @@
{
"name" : "Scroll",
"description" : "Scrolls the image horizontally or vertically.",
"group" : "image",
"preview" : "preview/project.json",
"passes" :
[
{
"material" : "materials/effects/scroll.json"
}
],
"dependencies" :
[
"materials/effects/scroll.json",
"shaders/effects/scroll.frag",
"shaders/effects/scroll.vert"
]
}

View File

@@ -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"
]
}

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
}

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,9 @@
{
"passes": [{
"shader": "effects/spin",
"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,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"
}

View File

@@ -0,0 +1,92 @@
{
"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",
"copybackground" : true,
"depth" : 1,
"effects" :
[
{
"file" : "effects/scroll/effect.json",
"passes" :
[
{
"constantshadervalues" :
{
"Speed X" : 0.93000000715255737,
"Speed Y" : 0
}
}
]
}
],
"id" : 38,
"image" : "models/effectpreview.json",
"name" : "",
"origin" : "127.000 127.000 0.000",
"parallaxDepth" : "1.000 1.000",
"scale" : "1.000 1.000 1.000",
"size" : "256.000 256.000",
"visible" : true
},
{
"angles" : "0.000 0.000 0.000",
"copybackground" : true,
"effects" :
[
{
"file" : "effects/motionblur/effect.json",
"passes" :
[
{
"constantshadervalues" :
{
"Accumulation rate" : 0.20999999344348907
},
"textures" : [ null, "_rt_FullCompoBuffer1_fullscreen_15" ]
},
{}
]
}
],
"id" : 18,
"image" : "models/util/fullscreenlayer.json",
"name" : "Fullscreen",
"origin" : "0.000 0.000 0.000",
"parallaxDepth" : "1.000 1.000",
"scale" : "1.000 1.000 1.000",
"size" : "620.000 521.000",
"visible" : true
}
]
}

View File

@@ -0,0 +1,21 @@
varying vec4 v_TexCoord;
uniform sampler2D g_Texture0; // {"material":"Framebuffer","hidden":true}
uniform sampler2D g_Texture1; // {"material":"Previous framebuffer","hidden":true}
uniform sampler2D g_Texture2; // {"material":"Mask","mode":"opacitymask","default":"util/white","combo":"MASK"}
uniform float g_Amount; // {"material":"Accumulation rate","default":0.8,"range":[0.01, 1]}
void main() {
vec4 albedo = texSample2D(g_Texture0, v_TexCoord.xy);
vec4 pastAlbedo = texSample2D(g_Texture1, v_TexCoord.xy);
float rate = g_Amount;
#if MASK == 1
float mask = texSample2D(g_Texture2, v_TexCoord.zw).r;
rate = g_Amount + (1.0 - g_Amount) * (1.0 - mask);
#endif
gl_FragColor = mix(pastAlbedo, albedo, rate);
}

View File

@@ -0,0 +1,19 @@
#if MASK == 1
uniform vec4 g_Texture2Resolution;
#endif
attribute vec3 a_Position;
attribute vec2 a_TexCoord;
varying vec4 v_TexCoord;
void main() {
gl_Position = vec4(a_Position, 1.0);
v_TexCoord.xyzw = a_TexCoord.xyxy;
#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
}

View File

@@ -0,0 +1,9 @@
varying vec2 v_TexCoord;
uniform sampler2D g_Texture0; // {"material":"Framebuffer","hidden":true}
void main() {
vec4 albedo = texSample2D(g_Texture0, v_TexCoord);
gl_FragColor = albedo;
}

View File

@@ -0,0 +1,12 @@
uniform mat4 g_ModelViewProjectionMatrix;
attribute vec3 a_Position;
attribute vec2 a_TexCoord;
varying vec2 v_TexCoord;
void main() {
gl_Position = mul(vec4(a_Position, 1.0), g_ModelViewProjectionMatrix);
v_TexCoord = a_TexCoord;
}

View File

@@ -0,0 +1,10 @@
varying vec2 v_TexCoord;
varying vec2 v_Scroll;
uniform sampler2D g_Texture0; // {"material":"Framebuffer","hidden":true}
void main() {
vec2 texCoord = frac(v_TexCoord + v_Scroll);
gl_FragColor = texSample2D(g_Texture0, texCoord);
}

View File

@@ -0,0 +1,21 @@
uniform mat4 g_ModelViewProjectionMatrix;
uniform float g_Time;
uniform float g_ScrollX; // {"material":"Speed X","default":0.2,"range":[-2,2]}
uniform float g_ScrollY; // {"material":"Speed Y","default":0.2,"range":[-2,2]}
attribute vec3 a_Position;
attribute vec2 a_TexCoord;
varying vec2 v_TexCoord;
varying vec2 v_Scroll;
void main() {
gl_Position = mul(vec4(a_Position, 1.0), g_ModelViewProjectionMatrix);
v_TexCoord = a_TexCoord;
vec2 scroll = vec2(g_ScrollX, g_ScrollY);
scroll = sign(scroll) * pow(vec2(g_ScrollX, g_ScrollY), CAST2(2.0));
v_Scroll = scroll * g_Time;
}

View File

@@ -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
}

View File

@@ -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
}

View File

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