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,18 @@
{
"name" : "Blend",
"description" : "Blend two images with various modes.",
"group" : "image",
//"preview" : "preview/project.json",
"passes" :
[
{
"material" : "materials/effects/blend.json"
}
],
"dependencies" :
[
"materials/effects/blend.json",
"shaders/effects/blend.frag",
"shaders/effects/blend.vert"
]
}

View File

@@ -0,0 +1,18 @@
{
"name" : "Opacity",
"description" : "Adds an opacity mask to the image.",
"group" : "image",
"preview" : "preview/project.json",
"passes" :
[
{
"material" : "materials/effects/opacity.json"
}
],
"dependencies" :
[
"materials/effects/opacity.json",
"shaders/effects/opacity.frag",
"shaders/effects/opacity.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,18 @@
{
"name" : "Transform",
"description" : "Apply scaling, rotation and offsets to the image.",
"group" : "image",
"preview" : "preview/project.json",
"passes" :
[
{
"material" : "materials/effects/transform.json"
}
],
"dependencies" :
[
"materials/effects/transform.json",
"shaders/effects/transform.frag",
"shaders/effects/transform.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/blend",
"blending": "normal",
"depthtest": "disabled",
"depthwrite": "disabled",
"cullmode": "nocull"
}]
}

View File

@@ -0,0 +1,9 @@
{
"passes": [{
"shader": "effects/opacity",
"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,9 @@
{
"passes": [{
"shader": "effects/transform",
"blending": "normal",
"depthtest": "disabled",
"depthwrite": "disabled",
"cullmode": "nocull"
}]
}

View File

@@ -0,0 +1,5 @@
{
"format" : "rgba8888",
"nomip" : true,
"nonpoweroftwo" : true
}

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" : "previewblend",
"type" : "scene"
}

View File

@@ -0,0 +1,115 @@
{
"camera" :
{
"center" : "-121.595 -15.576 -1.000",
"eye" : "-121.595 -15.576 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",
"dependencies" : [ 15 ],
"depth" : 1,
"effects" :
[
{
"file" : "effects/blend/effect.json",
"passes" :
[
{
"combos" :
{
"BLENDMODE" : 23
},
"constantshadervalues" : null,
"textures" : [ null, "_rt_imageLayerComposite_15_a" ]
}
]
}
],
"id" : 38,
"image" : "models/effectpreview.json",
"name" : "",
"origin" : "128.000 128.000 0.000",
"scale" : "1.000 1.000 1.000"
},
{
"angles" : "0.000 0.000 0.000",
"depth" : 1,
"effects" :
[
{
"file" : "effects/transform/effect.json",
"passes" :
[
{
"combos" :
{
"CLAMP" : 1,
"MODE" : 0
},
"constantshadervalues" :
{
"Angle" : 0,
"Scale" : "3 3"
}
}
]
},
{
"file" : "effects/spin/effect.json",
"passes" :
[
{
"combos" :
{
"MODE" : 0
},
"constantshadervalues" : null
}
]
},
{
"file" : "effects/opacity/effect.json",
"passes" :
[
{
"combos" : null,
"constantshadervalues" : null,
"textures" : [ null, "masks/opacity_mask_ee0d9bbc6d0516b8583c8fb3e841485c0b7ec4e8" ]
}
]
}
],
"id" : 15,
"image" : "models/effectpreview.json",
"name" : "effectpreview",
"origin" : "-204.142 136.225 0.000",
"scale" : "1.000 1.000 1.000"
}
]
}

View File

@@ -0,0 +1,18 @@
// [COMBO] {"material":"Blend mode","combo":"BLENDMODE","type":"imageblending","default":2}
#include "common_blending.h"
varying vec4 v_TexCoord;
uniform sampler2D g_Texture0; // {"material":"Framebuffer","hidden":true}
uniform sampler2D g_Texture1; // {"material":"Color mask","mode":"rgbmask","default":"util/white"}
void main() {
vec4 albedo = texSample2D(g_Texture0, v_TexCoord.xy);
vec4 mask = texSample2D(g_Texture1, v_TexCoord.zw);
albedo.rgb = ApplyBlending(BLENDMODE, albedo.rgb, mask.rgb, mask.a);
gl_FragColor = albedo;
}

View File

@@ -0,0 +1,15 @@
uniform mat4 g_ModelViewProjectionMatrix;
uniform vec4 g_Texture1Resolution;
attribute vec3 a_Position;
attribute vec2 a_TexCoord;
varying vec4 v_TexCoord;
void main() {
gl_Position = mul(vec4(a_Position, 1.0), g_ModelViewProjectionMatrix);
v_TexCoord.xy = a_TexCoord;
v_TexCoord.zw = vec2(v_TexCoord.x * g_Texture1Resolution.z / g_Texture1Resolution.x,
v_TexCoord.y * g_Texture1Resolution.w / g_Texture1Resolution.y);
}

View File

@@ -0,0 +1,13 @@
varying vec4 v_TexCoord;
uniform sampler2D g_Texture0; // {"material":"Framebuffer","hidden":true}
uniform sampler2D g_Texture1; // {"material":"Mask","mode":"opacitymask","default":"util/white"}
void main() {
vec4 albedo = texSample2D(g_Texture0, v_TexCoord.xy);
float mask = texSample2D(g_Texture1, v_TexCoord.zw).r;
albedo.a *= mask;
gl_FragColor = albedo;
}

View File

@@ -0,0 +1,15 @@
uniform mat4 g_ModelViewProjectionMatrix;
uniform vec4 g_Texture1Resolution;
attribute vec3 a_Position;
attribute vec2 a_TexCoord;
varying vec4 v_TexCoord;
void main() {
gl_Position = mul(vec4(a_Position, 1.0), g_ModelViewProjectionMatrix);
v_TexCoord.xy = a_TexCoord;
v_TexCoord.zw = vec2(v_TexCoord.x * g_Texture1Resolution.z / g_Texture1Resolution.x,
v_TexCoord.y * g_Texture1Resolution.w / g_Texture1Resolution.y);
}

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,14 @@
// [COMBO] {"material":"Repeat","combo":"CLAMP","type":"options","default":1}
varying vec2 v_TexCoord;
uniform sampler2D g_Texture0; // {"material":"Framebuffer","hidden":true}
void main() {
vec2 texCoord = v_TexCoord;
#if CLAMP
texCoord = frac(texCoord);
#endif
gl_FragColor = texSample2D(g_Texture0, texCoord);
}

View File

@@ -0,0 +1,29 @@
// [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 float g_Speed; // {"material":"Speed","default":1.0,"range":[-5,5]}
attribute vec3 a_Position;
attribute vec2 a_TexCoord;
varying vec2 v_TexCoord;
void main() {
vec3 position = a_Position;
#if MODE == 1
position.xy = rotateVec2(position.xy - CAST2(0.5), g_Speed * g_Time) + CAST2(0.5);
#endif
gl_Position = mul(vec4(position, 1.0), g_ModelViewProjectionMatrix);
v_TexCoord = a_TexCoord;
#if MODE == 0
v_TexCoord = rotateVec2(v_TexCoord - CAST2(0.5), g_Speed * g_Time) + CAST2(0.5);
#endif
}

View File

@@ -0,0 +1,14 @@
// [COMBO] {"material":"Repeat","combo":"CLAMP","type":"options","default":0}
varying vec2 v_TexCoord;
uniform sampler2D g_Texture0; // {"material":"Framebuffer","hidden":true}
void main() {
vec2 texCoord = v_TexCoord;
#if CLAMP
texCoord = frac(texCoord);
#endif
gl_FragColor = texSample2D(g_Texture0, texCoord);
}

View File

@@ -0,0 +1,35 @@
// [COMBO] {"material":"Mode","combo":"MODE","type":"options","default":0,"options":{"Vertex":1,"UV":0}}
#include "common.h"
uniform mat4 g_ModelViewProjectionMatrix;
uniform vec2 g_Offset; // {"material":"Offset","default":"0 0"}
uniform vec2 g_Scale; // {"material":"Scale","default":"1 1"}
uniform float g_Direction; // {"material":"Angle","default":0,"range":[0,6.28]}
attribute vec3 a_Position;
attribute vec2 a_TexCoord;
varying vec2 v_TexCoord;
vec2 applyFx(vec2 v) {
v = rotateVec2(v - CAST2(0.5), g_Direction);
return (v + g_Offset) * g_Scale + CAST2(0.5);
}
void main() {
vec3 position = a_Position;
#if MODE == 1
position.xy = applyFx(position.xy);
#endif
gl_Position = mul(vec4(position, 1.0), g_ModelViewProjectionMatrix);
v_TexCoord = a_TexCoord;
#if MODE == 0
v_TexCoord = applyFx(v_TexCoord);
#endif
}

View File

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