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

View File

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

View File

@@ -0,0 +1,18 @@
{
"name" : "Fisheye",
"description" : "Adds a fisheye warp.",
"group" : "distort",
//"preview" : "preview/project.json",
"passes" :
[
{
"material" : "materials/effects/fisheye.json"
}
],
"dependencies" :
[
"materials/effects/fisheye.json",
"shaders/effects/fisheye.frag",
"shaders/effects/fisheye.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/fisheye",
"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,64 @@
{
"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/fisheye/effect.json",
"passes" :
[
{
"constantshadervalues" :
{
"Distortion" : 1.7000000476837158,
"Size" : 1
}
}
]
}
],
"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
}
]
}

View File

@@ -0,0 +1,46 @@
// [COMBO] {"material":"Background","combo":"BACKGROUND","type":"options","default":1}
#include "common.h"
varying vec2 v_TexCoord;
uniform sampler2D g_Texture0; // {"material":"Framebuffer","hidden":true}
uniform float g_Size; // {"material":"Size","default":1,"range":[0.01, 1]}
uniform float g_Scale; // {"material":"Distortion","default":1,"range":[0, 2.5]}
uniform vec2 g_Center; // {"material":"Center","default":"0.5 0.5"}
void main() {
//vec4 albedo = texSample2D(g_Texture0, v_TexCoord.xy);
float aperture = 178.0;
float apertureHalf = 0.5 * aperture * (M_PI / 180.0);
float maxFactor = sin(apertureHalf);
vec2 uv;
vec2 xy = (v_TexCoord.xy - g_Center) * 2.0 / g_Size;
float d = length(xy);
float alpha = 1.0;
if (d < (2.0 - maxFactor))
{
d = length(xy * maxFactor);
float z = sqrt(1.0 - d * d);
float r = atan2(d, z) / M_PI;
float phi = atan2(xy.y, xy.x);
uv.x = r * cos(phi) * g_Size + g_Center.x;
uv.y = r * sin(phi) * g_Size + g_Center.y;
}
else
{
uv = v_TexCoord.xy;
#if BACKGROUND == 0
alpha = 0.0;
#endif
}
vec4 albedo = texSample2D(g_Texture0, mix(v_TexCoord.xy, uv, g_Scale));
albedo.a *= alpha;
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.xy = a_TexCoord;
}

View File

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

View File

@@ -0,0 +1,46 @@
// [COMBO] {"material":"ui_editor_properties_background","combo":"BACKGROUND","type":"options","default":1}
#include "common.h"
varying vec2 v_TexCoord;
uniform sampler2D g_Texture0; // {"hidden":true}
uniform float g_Size; // {"material":"size","label":"ui_editor_properties_size","default":1,"range":[0.01, 1]}
uniform float g_Scale; // {"material":"distortion","label":"ui_editor_properties_distortion","default":1,"range":[0, 2.5]}
uniform vec2 g_Center; // {"material":"center","label":"ui_editor_properties_center","default":"0.5 0.5","position":true}
void main() {
//vec4 albedo = texSample2D(g_Texture0, v_TexCoord.xy);
float aperture = 178.0;
float apertureHalf = 0.5 * aperture * (M_PI / 180.0);
float maxFactor = sin(apertureHalf);
vec2 uv;
vec2 xy = (v_TexCoord.xy - g_Center) * 2.0 / g_Size;
float d = length(xy);
float alpha = 1.0;
if (d < (2.0 - maxFactor))
{
d = length(xy * maxFactor);
float z = sqrt(1.0 - d * d);
float r = atan2(d, z) / M_PI;
float phi = atan2(xy.y, xy.x);
uv.x = r * cos(phi) * g_Size + g_Center.x;
uv.y = r * sin(phi) * g_Size + g_Center.y;
}
else
{
uv = v_TexCoord.xy;
#if BACKGROUND == 0
alpha = 0.0;
#endif
}
vec4 albedo = texSample2D(g_Texture0, mix(v_TexCoord.xy, uv, g_Scale));
albedo.a *= alpha;
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.xy = a_TexCoord;
}