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,33 @@
{
"version" : 1,
"replacementkey" : "lightshafts",
"name" : "ui_editor_effect_light_shafts_title",
"description" : "ui_editor_effect_light_shafts_description",
"group" : "colorize",
"preview" : "preview/project.json",
"passes" :
[
{
"material" : "materials/effects/lightshafts.json"
}
],
"dependencies" :
[
"materials/effects/lightshafts.json",
"shaders/effects/lightshafts.frag",
"shaders/effects/lightshafts.vert"
],
"gizmos" :
[
{
"type" : "EffectPerspectiveUV",
"vars" :
{
"p0" : "point0",
"p1" : "point1",
"p2" : "point2",
"p3" : "point3"
}
}
]
}

View File

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

View File

@@ -0,0 +1,275 @@
{
"name" : "ui_editor_preset_light_shafts_title",
"description" : "ui_editor_preset_light_shafts_description",
"tag" : "scene2d",
"group" : "preset",
"options" :
{
"droplistVisible" : true,
"droplistOptions" :
[
{
"label" : "ui_editor_preset_light_shafts_variant_corner",
"value" : 0
},
{
"label" : "ui_editor_preset_light_shafts_variant_radial",
"value" : 1
},
{
"label" : "ui_editor_preset_light_shafts_variant_directional",
"value" : 2
},
{
"label" : "ui_editor_preset_light_shafts_variant_dust_motes",
"value" : 3
},
{
"label" : "ui_editor_preset_light_shafts_variant_1",
"value" : 4
},
{
"label" : "ui_editor_preset_light_shafts_variant_2",
"value" : 5
},
{
"label" : "ui_editor_preset_light_shafts_variant_3",
"value" : 6
}
]
},
"variants" :
[
{
"preview" : "",
"objects" :
[
{
"castshadow" : false,
"effects" :
[
{
"file" : "effects/lightshafts/effect.json",
"name" : "",
"passes" :
[
{
"combos" :
{
"RAYMODE" : 2,
"RENDERING" : 1
},
"constantshadervalues" :
{
"colorastart" : "1 1 1",
"colorend" : "0.43529411764705883 0.8862745098039215 1",
"colorwexponent" : 1,
"colorwintensity" : 2,
"noiseamount" : 0.33000001,
"noisescale" : 0.85,
"point0" : "0.85704 0.06238",
"point1" : "0.94690 0.66185",
"point2" : "0.07415 0.95000",
"point3" : "0.24560 0.09457",
"rayfeather" : "0.22 0.1",
"rayradius" : 0.15,
"rayscale" : "0.4 1.01",
"raysmoothness" : 0.54,
"rayspeed" : 0.38999999
}
}
],
"visible" : true
}
],
"name" : "Light shafts - corner",
"shape" : "quad"
}
],
"dependencies" :
[
{
"file" : "effects/lightshafts/effect.json"
}
]
},
{
"preview" : "",
"objects" :
[
{
"castshadow" : false,
"effects" :
[
{
"file" : "effects/lightshafts/effect.json",
"name" : "",
"passes" :
[
{
"combos" :
{
"RAYMODE" : 1,
"RENDERING" : 1
},
"constantshadervalues" :
{
"colorastart" : "1 1 1",
"colorend" : "0.43529411764705883 0.8862745098039215 1",
"colorwexponent" : 1.12,
"colorwintensity" : 2,
"noiseamount" : 0.33000001,
"noisescale" : 1.17,
"point0" : "0.75 0.25",
"point1" : "0.75 0.75",
"point2" : "0.25 0.75",
"point3" : "0.25 0.25",
"rayfeather" : "0.01 0.07",
"rayradius" : 0.14,
"rayscale" : "0.66 1.01",
"raysmoothness" : 0.6,
"rayspeed" : 0.38999999
}
}
],
"visible" : true
}
],
"name" : "Light shafts - radial",
"shape" : "quad"
}
],
"dependencies" :
[
{
"file" : "effects/lightshafts/effect.json"
}
]
},
{
"preview" : "",
"objects" :
[
{
"castshadow" : false,
"effects" :
[
{
"file" : "effects/lightshafts/effect.json",
"name" : "",
"passes" :
[
{
"combos" :
{
"RAYMODE" : 0,
"RENDERING" : 1
},
"constantshadervalues" :
{
"colorastart" : "1 1 1",
"colorend" : "0.43529411764705883 0.8862745098039215 1",
"colorwexponent" : 0.9,
"colorwintensity" : 2,
"noiseamount" : 0.33000001,
"noisescale" : 1.17,
"point0" : "0.4 0.25",
"point1" : "0.6 0.25",
"point2" : "0.8 0.8",
"point3" : "0.2 0.8",
"rayfeather" : "0.16 0.13",
"rayradius" : 0.14,
"rayscale" : "0.8 0.2",
"raysmoothness" : 0.5,
"rayspeed" : 0.38999999
}
}
],
"visible" : true
}
],
"name" : "Light shafts - linear",
"shape" : "quad"
}
],
"dependencies" :
[
{
"file" : "effects/lightshafts/effect.json"
}
]
},
{
"preview" : "previewdustmotes0/project.json",
"objects" :
[
{
"angles" : "0.000 0.000 0.000",
"name" : "Dust motes",
"origin" : "0.000 0.000 0.000",
"particle" : "particles/presets/dust_motes_0.json",
"scale" : "1.000 1.000 1.000"
}
],
"dependencies" :
[
"materials/presets/dust_motes_0.json",
"particles/presets/dust_motes_0.json"
]
},
{
"preview" : "previewlightshafts0/project.json",
"objects" :
[
{
"angles" : "0.000 0.000 0.000",
"name" : "Light shafts 0",
"origin" : "0.000 0.000 0.000",
"particle" : "particles/presets/light_shafts_0.json",
"scale" : "1.000 1.000 1.000"
}
],
"dependencies" :
[
"materials/presets/light_shafts_0.json",
"particles/presets/light_shafts_0.json"
]
},
{
"preview" : "previewlightshafts1/project.json",
"objects" :
[
{
"angles" : "0.000 0.000 0.000",
"name" : "Light shafts 1",
"origin" : "0.000 0.000 0.000",
"particle" : "particles/presets/light_shafts_1.json",
"scale" : "1.000 1.000 1.000"
}
],
"dependencies" :
[
"materials/presets/light_shafts_1.json",
"particles/presets/light_shafts_1.json"
]
},
{
"preview" : "previewlightshafts2/project.json",
"objects" :
[
{
"angles" : "0.000 0.000 0.000",
"name" : "Light shafts 2",
"origin" : "0.000 0.000 0.000",
"particle" : "particles/presets/light_shafts_2.json",
"scale" : "1.000 1.000 1.000"
}
],
"dependencies" :
[
"materials/presets/light_shafts_2.json",
"particles/presets/light_shafts_2.json"
]
}
]
}

View File

@@ -0,0 +1,19 @@
{
"file" : "scene.json",
"general" :
{
"properties" :
{
"schemecolor" :
{
"order" : 0,
"text" : "ui_browse_properties_scheme_color",
"type" : "color",
"value" : "0 0 0"
}
}
},
"title" : "previewlightshafteffectcorner",
"type" : "scene",
"version" : 0
}

View File

@@ -0,0 +1,96 @@
{
"camera" :
{
"center" : "0.00000 0.00000 -1.00000",
"eye" : "0.00000 0.00000 0.00000",
"up" : "0.00000 1.00000 0.00000"
},
"general" :
{
"ambientcolor" : "0.30000 0.30000 0.30000",
"bloom" : false,
"bloomhdrfeather" : 0.1,
"bloomhdriterations" : 8,
"bloomhdrscatter" : 1.619,
"bloomhdrstrength" : 2.0,
"bloomhdrthreshold" : 1.0,
"bloomstrength" : 2.0,
"bloomthreshold" : 0.64999998,
"bloomtint" : "1.00000 1.00000 1.00000",
"camerafade" : true,
"cameraparallax" : false,
"cameraparallaxamount" : 0.5,
"cameraparallaxdelay" : 0.1,
"cameraparallaxmouseinfluence" : 0.0,
"camerapreview" : true,
"camerashake" : false,
"camerashakeamplitude" : 0.5,
"camerashakeroughness" : 1.0,
"camerashakespeed" : 3.0,
"clearcolor" : "0.38824 0.38824 0.38824",
"clearenabled" : true,
"farz" : 10000.0,
"fov" : 50.0,
"hdr" : false,
"nearz" : 0.0099999998,
"orthogonalprojection" :
{
"height" : 256,
"width" : 256
},
"perspectiveoverridefov" : 95.0,
"skylightcolor" : "0.30000 0.30000 0.30000",
"zoom" : 1.0
},
"objects" :
[
{
"castshadow" : false,
"effects" :
[
{
"file" : "effects/lightshafts/effect.json",
"id" : 14,
"name" : "",
"passes" :
[
{
"combos" :
{
"DIRECTDRAW" : 1,
"RAYMODE" : 2,
"RENDERING" : 1
},
"constantshadervalues" :
{
"colorastart" : "1 1 1",
"colorend" : "0.43529411764705883 0.8862745098039215 1",
"colorwexponent" : 1,
"colorwintensity" : 2,
"noiseamount" : 0.33000001,
"noisescale" : 0.85,
"point0" : "0.85704 0.06238",
"point1" : "0.94690 0.66185",
"point2" : "0.07415 0.95000",
"point3" : "0.24560 0.09457",
"rayfeather" : "0.22 0.1",
"rayradius" : 0.15,
"rayscale" : "0.4 1.01",
"raysmoothness" : 0.54,
"rayspeed" : 0.38999999
},
"id" : 15
}
],
"visible" : true
}
],
"id" : 13,
"name" : "Light shafts - corner",
"origin" : "135.21112 117.58400 0.00000",
"scale" : "1.20791 1.20791 1.20791",
"shape" : "quad"
}
],
"version" : 0
}

View File

@@ -0,0 +1,124 @@
// [COMBO] {"material":"ui_editor_properties_blend_mode","combo":"BLENDMODE","type":"imageblending","default":31,"require":{"DIRECTDRAW":0}}
// [COMBO] {"material":"ui_editor_properties_write_alpha","combo":"WRITEALPHA","type":"options","default":0,"require":{"DIRECTDRAW":0}}
// [COMBO] {"material":"ui_editor_properties_direction","combo":"RAYMODE","type":"options","default":0,"options":{"ui_editor_properties_directional":0,"ui_editor_properties_radial":1,"ui_editor_properties_corner":2}}
// [COMBO] {"material":"ui_editor_properties_rendering","combo":"RENDERING","type":"options","default":0,"options":{"ui_editor_properties_color":0,"ui_editor_properties_gradient":1}}
#include "common_fragment.h"
#include "common_blending.h"
varying vec4 v_TexCoord;
varying vec3 v_TexCoordFx;
uniform sampler2D g_Texture0; // {"hidden":true}
uniform sampler2D g_Texture1; // {"label":"ui_editor_properties_noise","default":"util/noise"}
uniform sampler2D g_Texture2; // {"label":"ui_editor_properties_gradient_map","default":"gradient/gradient_iridescent","formatcombo":true,"require":{"RENDERING":1}}
uniform sampler2D g_Texture3; // {"label":"ui_editor_properties_opacity_mask","mode":"opacitymask","combo":"MASK","paintdefaultcolor":"0 0 0 1","require":{"DIRECTDRAW":0}}
uniform float g_Time;
uniform float g_Speed; // {"material":"rayspeed","label":"ui_editor_properties_speed","default":0.2,"range":[0.1, 1.0],"group":"ui_editor_properties_shape"}
uniform vec2 g_Scale; // {"material":"rayscale","label":"ui_editor_properties_scale","default":"0.5 0.1","linked":true,"range":[0.1, 2.0],"group":"ui_editor_properties_shape","group":"ui_editor_properties_shape"}
uniform float g_Smoothness; // {"material":"raysmoothness","label":"ui_editor_properties_smoothness","default":0.75,"range":[0.1, 1.0],"group":"ui_editor_properties_blending"}
uniform vec2 g_Feather; // {"material":"rayfeather","label":"ui_editor_properties_feather","default":"0.05 0.2","linked":true,"range":[0.0, 0.5],"group":"ui_editor_properties_blending"}
uniform float g_Radius; // {"material":"rayradius","label":"ui_editor_properties_radius","default":0.2,"range":[0.0, 1.0],"group":"ui_editor_properties_shape"}
uniform float g_NoiseScale; // {"material":"noisescale","label":"ui_editor_properties_noise_scale","default":1.0,"range":[0.0, 5.0],"group":"ui_editor_properties_shape"}
uniform float g_NoiseAmount; // {"material":"noiseamount","label":"ui_editor_properties_noise_amount","default":0.33,"range":[0.0, 1.0],"group":"ui_editor_properties_shape"}
uniform float g_Intensity; // {"material":"colorwintensity","label":"ui_editor_properties_intensity","default":1,"range":[0.01, 10.0],"group":"ui_editor_properties_blending"}
uniform float g_Exponent; // {"material":"colorwexponent","label":"ui_editor_properties_exponent","default":1,"range":[0.2, 2.0],"group":"ui_editor_properties_blending"}
uniform vec3 g_ColorRaysStart; // {"material":"colorastart","label":"ui_editor_properties_color_start","default":"1 1 1","type":"color","group":"ui_editor_properties_blending"}
uniform vec3 g_ColorRaysEnd; // {"material":"colorend","label":"ui_editor_properties_color_end","default":"0.5 0.8 1","type":"color","group":"ui_editor_properties_blending"}
void main() {
vec2 fxCoord = v_TexCoordFx.xy / v_TexCoordFx.z;
#if DIRECTDRAW
vec4 albedo = CAST4(0.0);
#else
vec4 albedo = texSample2D(g_Texture0, v_TexCoord.xy);
#endif
float mask = step(0.0, v_TexCoordFx.z);
vec2 shapeScale = g_Scale;
#if RAYMODE == 1
vec2 rayCenter = vec2(0.5, 0.5);
vec2 rayDelta = fxCoord - rayCenter;
fxCoord.x = atan2(rayDelta.y, rayDelta.x) / 6.283185 + 0.5;
fxCoord.y = length(rayDelta) * 2.0;
//fxCoord.y += texSample2D(g_Texture1, vec2(fxCoord.x * 0.054111 * g_NoiseScale, 0)).r * g_NoiseAmount - (g_NoiseAmount * 0.5);
fxCoord.y = smoothstep(g_Radius, 1.0, fxCoord.y);
fxCoord.y = (fxCoord.y - 0.0001) * 1.00021;
vec2 fxCoordRef = fxCoord;
shapeScale.x *= 4;
mask *= smoothstep(0.50001, 0.5 - g_Feather.x, abs(fxCoord.x - 0.5));
mask *= smoothstep(0.50001, 0.5 - g_Feather.y, abs(fxCoord.y - 0.5));
#elif RAYMODE == 2
vec2 rayCenter = vec2(0, 0);
vec2 rayDelta = fxCoord - rayCenter;
fxCoord.x = atan2(rayDelta.y, rayDelta.x) / 6.283185 * 4;
fxCoord.y = max(rayDelta.x, rayDelta.y);
//fxCoord.y = length(rayDelta);
fxCoord.y += texSample2D(g_Texture1, vec2(fxCoord.x * 0.054111 * g_NoiseScale, 0)).r * g_NoiseAmount - (g_NoiseAmount * 0.5);
fxCoord.y = smoothstep(g_Radius, 1.0, fxCoord.y);
vec2 fxCoordRef = fxCoord;
shapeScale.x *= 4;
mask *= smoothstep(0.50001, 0.5 - g_Feather.x, abs(fxCoord.x - 0.5));
mask *= smoothstep(0.50001, 0.5 - g_Feather.y, abs(fxCoord.y - 0.5));
#else
//fxCoord.y += texSample2D(g_Texture1, vec2(fxCoord.x * 0.054111 * g_NoiseScale, 0)).r * g_NoiseAmount - (g_NoiseAmount * 0.5);
vec2 fxCoordRef = fxCoord;
mask *= smoothstep(0.50001, 0.5 - g_Feather.x, abs(fxCoord.x - 0.5));
mask *= smoothstep(0.50001, 0.5 - g_Feather.y, abs(fxCoord.y - 0.5));
#endif
float grad = 1.0 - fxCoord.y;
mask *= grad;
vec2 fxCoord2 = fxCoord;
fxCoord.xy *= vec2(0.054111 * shapeScale.x, 0.003111 * shapeScale.y);
fxCoord2.xy *= vec2(0.07333 * shapeScale.x, 0.005967111 * shapeScale.y);
fxCoord.xy += g_Time * g_Speed * vec2(0.003, 0.000375111);
fxCoord2.xy -= g_Time * g_Speed * vec2(0.0047111, 0.0007399);
float fx0 = texSample2D(g_Texture1, fxCoord).r;
float fx1 = texSample2D(g_Texture1, fxCoord2).r;
float fx = fx0 * fx1;
fx = pow(fx, g_Exponent);
fx = smoothstep((1.0 - g_Smoothness) * 0.29999, 0.3 + g_Smoothness * 0.7, fx);
#if RENDERING == 0
vec3 fxColor = mix(g_ColorRaysStart, g_ColorRaysEnd, fxCoordRef.y) * g_Intensity;
#else
vec2 gradientUVs = vec2(fxCoordRef.y, 0);
#if TEX2FORMAT == FORMAT_R8 || TEX2FORMAT == FORMAT_RG88
vec3 gradColor = texSample2D(g_Texture2, gradientUVs).rrr;
#else
vec3 gradColor = texSample2D(g_Texture2, gradientUVs).rgb;
#endif
vec3 fxColor = gradColor * g_Intensity;
#endif
#if MASK
float maskSample = texSample2D(g_Texture3, v_TexCoord.zw).r;
//albedo = mix(sample, albedo, mask);
mask *= maskSample;
#endif
fx *= mask;
albedo.rgb = ApplyBlending(BLENDMODE, albedo.rgb, fxColor, fx);
albedo.a = max(albedo.a, fx);
#if WRITEALPHA
albedo.a = fx;
#endif
gl_FragColor = albedo;
}

View File

@@ -0,0 +1,34 @@
#include "common.h"
#include "common_perspective.h"
uniform mat4 g_ModelViewProjectionMatrix;
#if MASK
uniform vec4 g_Texture3Resolution;
#endif
uniform vec2 g_Point0; // {"material":"point0","label":"p0","default":"0.67728 0.01297","require":{"DIRECTDRAW":0}}
uniform vec2 g_Point1; // {"material":"point1","label":"p1","default":"0.76007 0.14043","require":{"DIRECTDRAW":0}}
uniform vec2 g_Point2; // {"material":"point2","label":"p2","default":"0.46654 1.09592","require":{"DIRECTDRAW":0}}
uniform vec2 g_Point3; // {"material":"point3","label":"p3","default":"0.16363 0.44881","require":{"DIRECTDRAW":0}}
attribute vec3 a_Position;
attribute vec2 a_TexCoord;
varying vec4 v_TexCoord;
varying vec3 v_TexCoordFx;
void main() {
mat3 xform = inverse(squareToQuad(g_Point0, g_Point1, g_Point2, g_Point3));
v_TexCoord = a_TexCoord.xyxy;
v_TexCoordFx = mul(vec3(a_TexCoord.xy, 1.0), xform);
gl_Position = mul(vec4(a_Position, 1.0), g_ModelViewProjectionMatrix);
#if MASK
v_TexCoord.zw = vec2(a_TexCoord.x * g_Texture3Resolution.z / g_Texture3Resolution.x,
a_TexCoord.y * g_Texture3Resolution.w / g_Texture3Resolution.y);
#endif
}

View File

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