mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 06:45:33 +00:00
Added VFEZ
This commit is contained in:
parent
273efaef03
commit
6d572503cb
59 changed files with 5796 additions and 0 deletions
2
VFEZ/.gitignore
vendored
Normal file
2
VFEZ/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
*.import
|
||||
*.uid
|
||||
BIN
VFEZ/Images/croco_sprite.png
(Stored with Git LFS)
Normal file
BIN
VFEZ/Images/croco_sprite.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
VFEZ/Images/vfez_examples.png
(Stored with Git LFS)
Normal file
BIN
VFEZ/Images/vfez_examples.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
VFEZ/Images/vfez_sample_effects.png
(Stored with Git LFS)
Normal file
BIN
VFEZ/Images/vfez_sample_effects.png
(Stored with Git LFS)
Normal file
Binary file not shown.
21
VFEZ/LICENSE
Normal file
21
VFEZ/LICENSE
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2025 Alexander Nikopoulos
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
29
VFEZ/README.md
Normal file
29
VFEZ/README.md
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
# VFEZ-godot
|
||||
<img src="Images/vfez_examples.png">
|
||||
|
||||
`VFEZ-godot` is a godot library for easy VFX generation. \
|
||||
`VFEZ-godot` provides flexible `2D` and `3D` materials that can create complex effects without writing code. \
|
||||
`VFEZ-godot` was tested in `Godot 4.3` and in `Godot 4.4`.
|
||||
|
||||
## Quickstart
|
||||
To get started with `VFEZ-godot` simply clone the repo inside your project and then create a new `Material`.
|
||||
* To create a 3D VFX, create a `VFEZMaterial3D` in a `MeshInstance3D` node.
|
||||
* To create a 2D VFX, create a `VFEZMaterial2D` in a `Sprite2D` or `TextureRect` node.
|
||||
* `VFEZMaterials` can also be used inside particle systems.
|
||||
* `VFEZ-godot` contains a big library of shader effects that can be stacked easily together.
|
||||
* The order of the listed effects corresponds to their execution order inside the shader for more transparent effect stacking.
|
||||
|
||||
<img src="Images/vfez_sample_effects.png" width=500>
|
||||
|
||||
## Technical details
|
||||
* A `VFEZMaterial` dynamically recompiles the `Shaders/vfez_template_3d.gdshaderinc` or the `Shaders/vfez_template_2d.gdshaderinc` every time an effect is enabled or disabled. That way the resulting material does not include excess code logic and is performant.
|
||||
* Every `VFEZMaterial` generates a unique shader file that contains the definitions (`#define`) of the enabled effects.
|
||||
* If you dont want to use the `VFEZMaterial3D` and `VFEZMaterial2D` in your project you can still use the library to stack effects in your custom shaders. You can see the `Shaders/vfez_2d_example.gdshader` and `Shaders/vfez_3d_example.gdshader` as guidelines on how to stack effects manually.
|
||||
|
||||
## TODO
|
||||
* Add more VFEZ effects
|
||||
* Add more usage tutorials
|
||||
|
||||
## Community Notes
|
||||
* Contributions are welcome.
|
||||
* If you encounter any bug let me know so I can fix it.
|
||||
25
VFEZ/Shaders/Effects/vfez_alpha_clip.gdshaderinc
Normal file
25
VFEZ/Shaders/Effects/vfez_alpha_clip.gdshaderinc
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
group_uniforms alpha_clip;
|
||||
uniform float alpha_clip_left: hint_range(0.0, 1.0) = 0;
|
||||
uniform float alpha_clip_right: hint_range(0.0, 1.0) = 0;
|
||||
uniform float alpha_clip_up: hint_range(0.0, 1.0) = 0;
|
||||
uniform float alpha_clip_down: hint_range(0.0, 1.0) = 0;
|
||||
group_uniforms;
|
||||
|
||||
float alpha_clip(float alpha, vec2 uv, vec2 main_texture_scale)
|
||||
{
|
||||
vec2 norm_uv = uv / main_texture_scale;
|
||||
|
||||
if (1. - alpha_clip_up - norm_uv.y < 0.)
|
||||
return 0.;
|
||||
|
||||
if (norm_uv.y - alpha_clip_down < 0.)
|
||||
return 0.;
|
||||
|
||||
if (1. - alpha_clip_right - norm_uv.x < 0.)
|
||||
return 0.;
|
||||
|
||||
if (norm_uv.x - alpha_clip_left < 0.)
|
||||
return 0.;
|
||||
|
||||
return alpha;
|
||||
}
|
||||
15
VFEZ/Shaders/Effects/vfez_alpha_cutoff.gdshaderinc
Normal file
15
VFEZ/Shaders/Effects/vfez_alpha_cutoff.gdshaderinc
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
group_uniforms alpha_cutoff;
|
||||
uniform float alpha_cuttof_value: hint_range(0.001, 1.) = 0.5;
|
||||
group_uniforms;
|
||||
|
||||
float alpha_cutoff(float alpha)
|
||||
{
|
||||
if (((1. - alpha_cuttof_value) - (1. - alpha) - 0.01) < 0.)
|
||||
{
|
||||
return 0.;
|
||||
}
|
||||
else
|
||||
{
|
||||
return alpha;
|
||||
}
|
||||
}
|
||||
67
VFEZ/Shaders/Effects/vfez_alpha_disolve.gdshaderinc
Normal file
67
VFEZ/Shaders/Effects/vfez_alpha_disolve.gdshaderinc
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
#ifndef VFEZ_UTILS
|
||||
#include "vfez_utils.gdshaderinc"
|
||||
#define VFEZ_UTILS
|
||||
#endif
|
||||
|
||||
group_uniforms alpha_disolve;
|
||||
uniform sampler2D alpha_disolve_texture: source_color;
|
||||
uniform vec2 alpha_disolve_texture_scale = vec2(1.);
|
||||
uniform vec2 alpha_disolve_texture_offset = vec2(0.);
|
||||
uniform float alpha_disolve_amount: hint_range(-0.1, 1) = -0.1;
|
||||
uniform float alpha_disolve_transition: hint_range(0.01, 0.75)= 0.075;
|
||||
uniform float alpha_disolve_power: hint_range(0.001, 10) = 1;
|
||||
uniform vec2 alpha_disolve_scroll_speed;
|
||||
group_uniforms;
|
||||
|
||||
// disolve burn
|
||||
group_uniforms alpha_disolve.disolve_burn;
|
||||
uniform bool use_alpha_disolve_burn = false;
|
||||
uniform sampler2D alpha_disolve_burn_texture: source_color;
|
||||
uniform vec3 alpha_disolve_burn_color: source_color = vec3(1., 1., 0.);
|
||||
uniform float alpha_disolve_burn_width: hint_range(0.0, 0.2) = 0.01;
|
||||
uniform float alpha_disolve_burn_glow: hint_range(1, 250) = 5;
|
||||
group_uniforms;
|
||||
|
||||
vec4 alpha_disolve(
|
||||
vec4 color,
|
||||
float pre_disolve_alpha,
|
||||
float base_a,
|
||||
vec2 uv,
|
||||
bool fract_uv)
|
||||
{
|
||||
vec2 disolve_uv = transform_uv(uv, alpha_disolve_texture_scale, alpha_disolve_texture_offset, fract_uv);
|
||||
|
||||
float disolve_amount = clamp(alpha_disolve_amount + (1. - base_a), 0., 1.);
|
||||
float disolve_transition = max(0.01, alpha_disolve_transition * ease_out_quint(disolve_amount));
|
||||
disolve_uv += mod(TIME * alpha_disolve_scroll_speed, 1.0);
|
||||
disolve_amount = clamp(pow(disolve_amount, alpha_disolve_power), 0., 1.);
|
||||
float disolve_sample = texture(alpha_disolve_texture, disolve_uv).r;
|
||||
float disolve = clamp(
|
||||
smoothstep(
|
||||
0.0,
|
||||
disolve_transition,
|
||||
remap_float(1.0 - disolve_amount, 0.0, 1.0, -1.0, 1.0) + disolve_sample
|
||||
), 0., 1.);
|
||||
|
||||
color.a *= disolve;
|
||||
|
||||
if (use_alpha_disolve_burn)
|
||||
{
|
||||
float disolve_burn = clamp(
|
||||
smoothstep(
|
||||
0.,
|
||||
disolve_transition + alpha_disolve_burn_width,
|
||||
remap_float(1.0 - disolve_amount, 0.0, 1.0, -1.0, 1.0) + disolve_sample
|
||||
), 0., 1.
|
||||
);
|
||||
|
||||
disolve_burn = disolve - disolve_burn;
|
||||
vec3 disolve_burn_color = alpha_disolve_burn_color.rgb * alpha_disolve_burn_glow;
|
||||
|
||||
color.rgb += disolve_burn *
|
||||
texture(alpha_disolve_burn_texture, disolve_uv).rgb
|
||||
* disolve_burn_color.rgb
|
||||
* pre_disolve_alpha;
|
||||
}
|
||||
return color;
|
||||
}
|
||||
13
VFEZ/Shaders/Effects/vfez_alpha_flicker.gdshaderinc
Normal file
13
VFEZ/Shaders/Effects/vfez_alpha_flicker.gdshaderinc
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
group_uniforms alpha_flicker;
|
||||
uniform float alpha_flicker_percent: hint_range(0., 1.) = 0.05;
|
||||
uniform float alpha_flicker_frequency: hint_range(0., 5.) = 0.2;
|
||||
uniform float alpha_flicker_value: hint_range(0.0, 1.0) = 0.;
|
||||
group_uniforms;
|
||||
|
||||
float alpha_flicker(float alpha)
|
||||
{
|
||||
alpha *= clamp(
|
||||
alpha * step(fract(0.05 + TIME * alpha_flicker_frequency),
|
||||
1. - alpha_flicker_percent) + alpha_flicker_value, 0., 1.);
|
||||
return alpha;
|
||||
}
|
||||
23
VFEZ/Shaders/Effects/vfez_alpha_mask.gdshaderinc
Normal file
23
VFEZ/Shaders/Effects/vfez_alpha_mask.gdshaderinc
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#ifndef VFEZ_UTILS
|
||||
#include "vfez_utils.gdshaderinc"
|
||||
#define VFEZ_UTILS
|
||||
#endif
|
||||
|
||||
group_uniforms alpha_mask;
|
||||
uniform sampler2D alpha_mask_texture: source_color;
|
||||
uniform vec2 alpha_mask_scale = vec2(1.);
|
||||
uniform vec2 alpha_mask_offset = vec2(0.);
|
||||
uniform float alpha_mask_power: hint_range(0.001, 10.) = 1;
|
||||
group_uniforms;
|
||||
|
||||
float alpha_mask(
|
||||
float alpha,
|
||||
vec2 uv,
|
||||
bool fract_uv)
|
||||
{
|
||||
vec2 alpha_mask_uv = transform_uv(uv, alpha_mask_scale, alpha_mask_offset, fract_uv);
|
||||
vec4 alpha_mask_sample = texture(alpha_mask_texture, alpha_mask_uv);
|
||||
float mask = pow(min(alpha_mask_sample.r, alpha_mask_sample.a), alpha_mask_power);
|
||||
alpha *= mask;
|
||||
return alpha;
|
||||
}
|
||||
28
VFEZ/Shaders/Effects/vfez_alpha_radial_clip.gdshaderinc
Normal file
28
VFEZ/Shaders/Effects/vfez_alpha_radial_clip.gdshaderinc
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
group_uniforms alpha_radial_clip;
|
||||
uniform float alpha_radial_clip_start_angle: hint_range(0.0, 360., 1.);
|
||||
uniform float alpha_radial_clip_one: hint_range(0.0, 360., 1.);
|
||||
uniform float alpha_radial_clip_two: hint_range(0.0, 360., 1.);
|
||||
group_uniforms;
|
||||
|
||||
float alpha_radial_clip(float alpha, vec2 uv, vec2 main_texture_scale)
|
||||
{
|
||||
vec2 norm_uv = uv / main_texture_scale;
|
||||
float start_angle = alpha_radial_clip_start_angle - alpha_radial_clip_one;
|
||||
float end_angle = alpha_radial_clip_start_angle + alpha_radial_clip_two;
|
||||
float offset_0 = clamp(0., 360., start_angle + 360.);
|
||||
float offset_360 = clamp(0., 360., end_angle - 360.);
|
||||
vec2 atan2Coord = vec2(mix(-1., 1., norm_uv.x), mix(-1., 1., norm_uv.y));
|
||||
float a_tan_angle = atan(atan2Coord.y, atan2Coord.x) * 57.3;
|
||||
if (a_tan_angle < 0.)
|
||||
a_tan_angle = 360. + a_tan_angle;
|
||||
|
||||
if (a_tan_angle >= start_angle && a_tan_angle <= end_angle)
|
||||
return 0.;
|
||||
|
||||
if (a_tan_angle <= offset_360)
|
||||
return 0.;
|
||||
|
||||
if (a_tan_angle >= offset_0)
|
||||
return 0.;
|
||||
return alpha;
|
||||
}
|
||||
10
VFEZ/Shaders/Effects/vfez_alpha_remap.gdshaderinc
Normal file
10
VFEZ/Shaders/Effects/vfez_alpha_remap.gdshaderinc
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
group_uniforms alpha_remap;
|
||||
uniform float alpha_remap_min: hint_range(0.0, 1.0) = 0;
|
||||
uniform float alpha_remap_max: hint_range(0.0, 1.0) = 0.075;
|
||||
group_uniforms;
|
||||
|
||||
float alpha_remap(float alpha)
|
||||
{
|
||||
alpha = smoothstep(alpha_remap_min, alpha_remap_max, alpha);
|
||||
return alpha;
|
||||
}
|
||||
18
VFEZ/Shaders/Effects/vfez_chromatic_aberration.gdshaderinc
Normal file
18
VFEZ/Shaders/Effects/vfez_chromatic_aberration.gdshaderinc
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
group_uniforms chromatic_aberration;
|
||||
uniform float chromatic_aberration_amount: hint_range(0.0, 1.0) = 1.;
|
||||
uniform float chromatic_aberration_alpha: hint_range(0.0, 1.0) = 0.4;
|
||||
group_uniforms;
|
||||
|
||||
vec4 chromatic_aberration(vec4 color, vec2 uv, sampler2D main_texture)
|
||||
{
|
||||
vec4 r = texture(main_texture,
|
||||
uv + vec2(chromatic_aberration_amount / 10., 0.));
|
||||
|
||||
vec4 b = texture(main_texture,
|
||||
uv + vec2(-chromatic_aberration_amount / 10., 0.));
|
||||
|
||||
color = vec4(r.r * r.a, color.g, b.b * b.a,
|
||||
max(max(r.a, b.a) * chromatic_aberration_alpha, color.a));
|
||||
|
||||
return color;
|
||||
}
|
||||
71
VFEZ/Shaders/Effects/vfez_color_change.gdshaderinc
Normal file
71
VFEZ/Shaders/Effects/vfez_color_change.gdshaderinc
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
#ifndef VFEZ_UTILS
|
||||
#include "vfez_utils.gdshaderinc"
|
||||
#define VFEZ_UTILS
|
||||
#endif
|
||||
|
||||
|
||||
group_uniforms color_change.color1;
|
||||
uniform bool change_color_1;
|
||||
uniform vec3 color_1_to_change: source_color;
|
||||
uniform vec3 color_1_to_replace: source_color;
|
||||
uniform float color_1_change_tolerance: hint_range(0.0, 1.0) = 0.1;
|
||||
group_uniforms;
|
||||
|
||||
group_uniforms color_change.color2;
|
||||
uniform bool change_color_2;
|
||||
uniform vec3 color_2_to_change: source_color;
|
||||
uniform vec3 color_2_to_replace: source_color;
|
||||
uniform float color_2_change_tolerance: hint_range(0.0, 1.0) = 0.1;
|
||||
group_uniforms;
|
||||
|
||||
group_uniforms color_change.color3;
|
||||
uniform bool change_color_3;
|
||||
uniform vec3 color_3_to_change: source_color;
|
||||
uniform vec3 color_3_to_replace: source_color;
|
||||
uniform float color_3_change_tolerance: hint_range(0.0, 1.0) = 0.1;
|
||||
group_uniforms;
|
||||
|
||||
vec3 change_single_color(
|
||||
vec3 color,
|
||||
vec3 color_to_change,
|
||||
vec3 color_to_replace,
|
||||
float color_change_tolerance)
|
||||
{
|
||||
vec3 dif = abs(color - color_to_change.rgb);
|
||||
color.rgb = mix(color, color_to_replace.rgb,
|
||||
max(sign(color_change_tolerance * 3. - dif.x - dif.y - dif.z), 0.0));
|
||||
return color;
|
||||
}
|
||||
|
||||
vec3 color_change(vec3 color)
|
||||
{
|
||||
color = clamp(color, 0., 1.);
|
||||
|
||||
if (change_color_1)
|
||||
{
|
||||
color = change_single_color(
|
||||
color,
|
||||
color_1_to_change,
|
||||
color_1_to_replace,
|
||||
color_1_change_tolerance);
|
||||
}
|
||||
|
||||
if (change_color_2)
|
||||
{
|
||||
color = change_single_color(
|
||||
color,
|
||||
color_2_to_change,
|
||||
color_2_to_replace,
|
||||
color_2_change_tolerance);
|
||||
}
|
||||
|
||||
if (change_color_3)
|
||||
{
|
||||
color = change_single_color(
|
||||
color,
|
||||
color_3_to_change,
|
||||
color_3_to_replace,
|
||||
color_3_change_tolerance);
|
||||
}
|
||||
return color;
|
||||
}
|
||||
16
VFEZ/Shaders/Effects/vfez_color_face_tint.gdshaderinc
Normal file
16
VFEZ/Shaders/Effects/vfez_color_face_tint.gdshaderinc
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
group_uniforms color_face_tint;
|
||||
uniform vec3 backface_tint_color: source_color = vec3(0.5);
|
||||
uniform vec3 frontface_tint_color: source_color = vec3(1.);
|
||||
group_uniforms;
|
||||
|
||||
vec3 color_face_tint(
|
||||
vec3 color,
|
||||
vec3 world_normal,
|
||||
vec3 view_direction)
|
||||
{
|
||||
color.rgb = mix(
|
||||
color.rgb * backface_tint_color,
|
||||
color.rgb * frontface_tint_color,
|
||||
step(0, dot(world_normal, view_direction)));
|
||||
return color;
|
||||
}
|
||||
20
VFEZ/Shaders/Effects/vfez_color_ghost.gdshaderinc
Normal file
20
VFEZ/Shaders/Effects/vfez_color_ghost.gdshaderinc
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#ifndef VFEZ_UTILS
|
||||
#include "vfez_utils.gdshaderinc"
|
||||
#define VFEZ_UTILS
|
||||
#endif
|
||||
|
||||
group_uniforms color_ghost;
|
||||
uniform float color_ghost_boost: hint_range(0.0, 5.) = 1.;
|
||||
uniform float color_ghost_transparency: hint_range(0.0, 1.0) = 0.;
|
||||
uniform float color_ghost_blend: hint_range(0.0, 1.0) = 1.;
|
||||
group_uniforms;
|
||||
|
||||
vec4 color_ghost(vec4 color)
|
||||
{
|
||||
float luminance = get_color_luminance(color);
|
||||
vec4 ghost;
|
||||
ghost.a = clamp(luminance - color_ghost_transparency, 0., 1.) * color.a;
|
||||
ghost.rgb = color.rgb * (luminance + color_ghost_boost);
|
||||
color = mix(color, ghost, color_ghost_blend);
|
||||
return color;
|
||||
}
|
||||
23
VFEZ/Shaders/Effects/vfez_color_glow.gdshaderinc
Normal file
23
VFEZ/Shaders/Effects/vfez_color_glow.gdshaderinc
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
group_uniforms color_glow;
|
||||
uniform vec4 glow_color: source_color = vec4(1.);
|
||||
uniform float glow_intensity = 0;
|
||||
uniform float glow_intensity_global = 1;
|
||||
uniform bool use_glow_texture = false;
|
||||
uniform sampler2D glow_texture: source_color;
|
||||
group_uniforms;
|
||||
|
||||
vec3 color_glow(
|
||||
vec4 color,
|
||||
vec2 uv,
|
||||
float glow_mult)
|
||||
{
|
||||
float glow_mask = 1.;
|
||||
if (use_glow_texture)
|
||||
{
|
||||
glow_mask = texture(glow_texture, uv).r;
|
||||
}
|
||||
|
||||
color.rgb *= glow_intensity_global * glow_mask;
|
||||
color.rgb += glow_color.rgb * glow_intensity * glow_mask * color.a * glow_mult;
|
||||
return color.rgb;
|
||||
}
|
||||
32
VFEZ/Shaders/Effects/vfez_color_gradient.gdshaderinc
Normal file
32
VFEZ/Shaders/Effects/vfez_color_gradient.gdshaderinc
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
group_uniforms color_gradient;
|
||||
uniform float color_gradient_blend: hint_range(0., 1.) = 0.5;
|
||||
uniform float color_gradient_boost_x: hint_range(0., 1.) = 0.5;
|
||||
uniform float color_gradient_boost_y: hint_range(0., 1.) = 0.5;
|
||||
uniform vec4 color_gradient_top_right_color: source_color = vec4(1,0,0,1);
|
||||
uniform vec4 color_gradient_bottom_right_color: source_color = vec4(0,1,0,1);
|
||||
uniform vec4 color_gradient_top_left_color: source_color = vec4(0,0,1,1);
|
||||
uniform vec4 color_gradient_bottom_left_color: source_color = vec4(1,1,0,1);
|
||||
group_uniforms;
|
||||
|
||||
vec4 color_gradient(vec4 color, vec2 uv, vec2 main_texture_scale)
|
||||
{
|
||||
vec2 norm_uv = uv / main_texture_scale;
|
||||
float grad_x_mix_factor = clamp(pow(norm_uv.x, color_gradient_boost_x), 0., 1.);
|
||||
float grad_y_mix_factor = clamp(pow(norm_uv.y, color_gradient_boost_y), 0., 1.);
|
||||
vec4 grad_result = mix(
|
||||
mix(
|
||||
color_gradient_bottom_left_color,
|
||||
color_gradient_bottom_right_color,
|
||||
grad_x_mix_factor),
|
||||
mix(
|
||||
color_gradient_top_left_color,
|
||||
color_gradient_top_right_color,
|
||||
grad_x_mix_factor),
|
||||
grad_y_mix_factor
|
||||
);
|
||||
|
||||
grad_result = mix(color, grad_result, color_gradient_blend);
|
||||
color.rgb = grad_result.rgb * color.a;
|
||||
color.a *= grad_result.a;
|
||||
return color;
|
||||
}
|
||||
18
VFEZ/Shaders/Effects/vfez_color_greyscale.gdshaderinc
Normal file
18
VFEZ/Shaders/Effects/vfez_color_greyscale.gdshaderinc
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#ifndef VFEZ_UTILS
|
||||
#include "vfez_utils.gdshaderinc"
|
||||
#define VFEZ_UTILS
|
||||
#endif
|
||||
|
||||
group_uniforms color_greyscale;
|
||||
uniform float color_greyscale_luminosity: hint_range(-1., 1.) = 0;
|
||||
uniform float color_greyscale_blend: hint_range(0., 1.) = 1.;
|
||||
uniform vec3 color_greyscale_tint: source_color = vec3(1.);
|
||||
group_uniforms;
|
||||
|
||||
vec3 color_greyscale(vec3 color)
|
||||
{
|
||||
float luminance = get_color_luminance(vec4(color, 1.));
|
||||
luminance = clamp(luminance + color_greyscale_luminosity, 0., 1.);
|
||||
color = mix(color, vec3(luminance) * color_greyscale_tint, color_greyscale_blend);
|
||||
return color;
|
||||
}
|
||||
34
VFEZ/Shaders/Effects/vfez_color_hologram.gdshaderinc
Normal file
34
VFEZ/Shaders/Effects/vfez_color_hologram.gdshaderinc
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#ifndef VFEZ_UTILS
|
||||
#include "vfez_utils.gdshaderinc"
|
||||
#define VFEZ_UTILS
|
||||
#endif
|
||||
|
||||
group_uniforms color_hologram;
|
||||
uniform vec3 color_hologram_stripes_color: source_color = vec3(0,1,1);
|
||||
uniform float color_hologram_stripes_amount: hint_range(0.0, 1.0) = 0.1;
|
||||
uniform float color_hologram_unchanged_amount: hint_range(0.0, 1.0) = 0.0;
|
||||
uniform float color_hologram_stripes_speed: hint_range(-20., 20.) = 4.5;
|
||||
uniform float color_hologram_min_alpha: hint_range(0.0, 1.0) = 0.1;
|
||||
uniform float color_hologram_max_alpha: hint_range(0.0, 1.0) = 0.75;
|
||||
uniform float color_hologram_blend: hint_range(0.0, 1.0) = 1.;
|
||||
group_uniforms;
|
||||
|
||||
vec4 color_hologram(vec4 color, vec2 uv)
|
||||
{
|
||||
float total_hologram = color_hologram_stripes_amount +
|
||||
color_hologram_unchanged_amount;
|
||||
|
||||
float hologram_y_coord = mod(uv.y + mod(TIME, 1.) * color_hologram_stripes_speed, total_hologram) / total_hologram;
|
||||
hologram_y_coord = abs(hologram_y_coord);
|
||||
float alpha = remap_float(
|
||||
clamp(hologram_y_coord - color_hologram_unchanged_amount / total_hologram, 0., 1.),
|
||||
0., 1., color_hologram_min_alpha, color_hologram_max_alpha);
|
||||
float hologram_mask = max(sign(color_hologram_unchanged_amount / total_hologram - hologram_y_coord), 0.0);
|
||||
vec4 hologram_result = color;
|
||||
hologram_result.a *= mix(alpha, 1., hologram_mask);
|
||||
hologram_result.rgb *= max(1., color_hologram_max_alpha * max (sign (hologram_y_coord - color_hologram_unchanged_amount / total_hologram), 0.0));
|
||||
hologram_mask = 1. - step(0.01, hologram_mask);
|
||||
hologram_result.rgb += hologram_mask * color_hologram_stripes_color.rgb * color.a;
|
||||
color = mix(color, hologram_result, color_hologram_blend);
|
||||
return color;
|
||||
}
|
||||
9
VFEZ/Shaders/Effects/vfez_color_negative.gdshaderinc
Normal file
9
VFEZ/Shaders/Effects/vfez_color_negative.gdshaderinc
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
group_uniforms color_negative;
|
||||
uniform float color_negative_blend: hint_range(0.0, 1.0) = 1.0;
|
||||
group_uniforms;
|
||||
|
||||
vec3 color_negative(vec3 color)
|
||||
{
|
||||
color = mix(color, 1. - color, color_negative_blend);
|
||||
return color;
|
||||
}
|
||||
40
VFEZ/Shaders/Effects/vfez_color_overlay_texture.gdshaderinc
Normal file
40
VFEZ/Shaders/Effects/vfez_color_overlay_texture.gdshaderinc
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
#ifndef VFEZ_UTILS
|
||||
#include "vfez_utils.gdshaderinc"
|
||||
#define VFEZ_UTILS
|
||||
#endif
|
||||
|
||||
group_uniforms color_overlay_texture;
|
||||
uniform sampler2D color_overlay_tex: source_color;
|
||||
uniform vec2 color_overlay_tex_scale = vec2(1.);
|
||||
uniform vec2 color_overlay_tex_offset = vec2(0.);
|
||||
uniform vec4 color_overlay_color: source_color = vec4(1.);
|
||||
uniform float color_overlay_glow: hint_range(0.0, 25) = 1.;
|
||||
uniform float color_overlay_blend: hint_range(0.0, 1.0) = 1.;
|
||||
uniform float color_overlay_tex_scroll_x: hint_range(-5, 5) = 0.25;
|
||||
uniform float color_overlay_tex_scroll_y: hint_range(-5, 5) = 0.25;
|
||||
uniform bool color_overlay_mult;
|
||||
group_uniforms;
|
||||
|
||||
vec4 color_overlay_texture(vec4 color, vec2 uv)
|
||||
{
|
||||
vec2 overlay_uv = uv;
|
||||
overlay_uv.x += TIME * color_overlay_tex_scroll_x;
|
||||
overlay_uv.y += TIME * color_overlay_tex_scroll_y;
|
||||
overlay_uv = fract(overlay_uv);
|
||||
overlay_uv = transform_uv(overlay_uv, color_overlay_tex_scale, color_overlay_tex_offset, true);
|
||||
vec4 final_overlay_color = texture(color_overlay_tex, overlay_uv);
|
||||
final_overlay_color.rgb *= color_overlay_color.rgb * color_overlay_glow;
|
||||
|
||||
if (color_overlay_mult)
|
||||
{
|
||||
final_overlay_color.a *= color_overlay_color.a;
|
||||
color = mix(color, color * final_overlay_color, color_overlay_blend);
|
||||
}
|
||||
else
|
||||
{
|
||||
final_overlay_color.rgb *= final_overlay_color.a * color_overlay_color.rgb * color_overlay_color.a * color_overlay_blend;
|
||||
color.rgb += final_overlay_color.rgb;
|
||||
}
|
||||
|
||||
return color;
|
||||
}
|
||||
9
VFEZ/Shaders/Effects/vfez_color_posterize.gdshaderinc
Normal file
9
VFEZ/Shaders/Effects/vfez_color_posterize.gdshaderinc
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
group_uniforms color_posterize;
|
||||
uniform float color_posterize_num_colors: hint_range(0.0, 30.) = 5.;
|
||||
group_uniforms;
|
||||
|
||||
vec3 color_posterize(vec3 color)
|
||||
{
|
||||
color = floor(color.rgb / (1.0 / color_posterize_num_colors)) * (1.0 / color_posterize_num_colors);
|
||||
return color;
|
||||
}
|
||||
24
VFEZ/Shaders/Effects/vfez_color_radial_gradient.gdshaderinc
Normal file
24
VFEZ/Shaders/Effects/vfez_color_radial_gradient.gdshaderinc
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
group_uniforms color_radial_gradient;
|
||||
uniform vec2 color_radial_gradient_center = vec2(0.5);
|
||||
uniform float color_radial_gradient_blend: hint_range(0., 1.) = 0.5;
|
||||
uniform float color_radial_gradient_boost: hint_range(0., 1.) = 0.5;
|
||||
uniform vec4 color_radial_gradient_color_one: source_color = vec4(1,0,0,1);
|
||||
uniform vec4 color_radial_gradient_color_two: source_color = vec4(0,1,0,1);
|
||||
group_uniforms;
|
||||
|
||||
vec4 color_radial_gradient(vec4 color, vec2 uv, vec2 main_texture_scale, vec2 viewport_size)
|
||||
{
|
||||
vec2 norm_uv = uv / main_texture_scale;
|
||||
float radial_dist = 1. - length(norm_uv - color_radial_gradient_center);
|
||||
radial_dist*= viewport_size.x / viewport_size.y;
|
||||
radial_dist = clamp(color_radial_gradient_boost * radial_dist, 0., 1.);
|
||||
vec4 grad_result = mix(
|
||||
color_radial_gradient_color_one,
|
||||
color_radial_gradient_color_two,
|
||||
radial_dist);
|
||||
|
||||
grad_result = mix(color, grad_result, color_radial_gradient_blend);
|
||||
color.rgb = grad_result.rgb * color.a;
|
||||
color.a *= grad_result.a;
|
||||
return color;
|
||||
}
|
||||
21
VFEZ/Shaders/Effects/vfez_color_ramp.gdshaderinc
Normal file
21
VFEZ/Shaders/Effects/vfez_color_ramp.gdshaderinc
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#ifndef VFEZ_UTILS
|
||||
#include "vfez_utils.gdshaderinc"
|
||||
#define VFEZ_UTILS
|
||||
#endif
|
||||
|
||||
group_uniforms color_ramp;
|
||||
uniform vec4 color_ramp_albedo: source_color = vec4(1.);
|
||||
uniform sampler2D color_ramp_texture: source_color, repeat_disable;
|
||||
uniform float color_ramp_luminosity: hint_range(-1., 1.) = 0.;
|
||||
uniform float color_ramp_blend: hint_range(0.0, 1.0) = 1.;
|
||||
group_uniforms;
|
||||
|
||||
vec4 color_ramp(vec4 color)
|
||||
{
|
||||
float luminance = get_color_luminance(color);
|
||||
float color_ramp_luminance = clamp(luminance + color_ramp_luminosity, 0., 1.);
|
||||
vec4 color_ramp_res = texture(color_ramp_texture, vec2(color_ramp_luminance)) * color_ramp_albedo;
|
||||
color.rgb = mix(color.rgb, color_ramp_res.rgb, color_ramp_blend);
|
||||
color.a = mix(color.a, clamp(color.a * color_ramp_res.a, 0., 1.), color_ramp_blend);
|
||||
return color;
|
||||
}
|
||||
31
VFEZ/Shaders/Effects/vfez_color_rim.gdshaderinc
Normal file
31
VFEZ/Shaders/Effects/vfez_color_rim.gdshaderinc
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
group_uniforms color_rim;
|
||||
uniform vec4 rim_color: source_color = vec4(1.);
|
||||
uniform float rim_bias: hint_range(0.0, 1.0) = 0.;
|
||||
uniform float rim_scale: hint_range(0.0, 25.0) = 1.;
|
||||
uniform float rim_power: hint_range(0.1, 20.0) = 5.;
|
||||
uniform float rim_intensity: hint_range(0.1, 50.0) = 1.;
|
||||
uniform float rim_add_amount: hint_range(0.1, 1.0) = 1.;
|
||||
uniform float rim_erodes_alpha: hint_range(0.1, 2.0) = 0.;
|
||||
group_uniforms;
|
||||
|
||||
vec4 color_rim(
|
||||
vec4 color,
|
||||
vec3 normal,
|
||||
vec3 view)
|
||||
{
|
||||
float ndv = 1. - abs(dot(normal, view));
|
||||
float rim_factor = clamp(
|
||||
rim_bias + rim_scale * pow(ndv, rim_power), 0., 1.);
|
||||
vec4 final_rim_color = rim_color * rim_factor;
|
||||
final_rim_color.rgb *= rim_intensity;
|
||||
color.rgb = mix(
|
||||
color.rgb * (final_rim_color.rgb + vec3(1.)),
|
||||
color.rgb + final_rim_color.rgb,
|
||||
rim_add_amount);
|
||||
color.a = clamp(
|
||||
color.a * (1. - rim_factor * rim_erodes_alpha),
|
||||
0.,
|
||||
1.);
|
||||
|
||||
return color;
|
||||
}
|
||||
17
VFEZ/Shaders/Effects/vfez_color_shadow.gdshaderinc
Normal file
17
VFEZ/Shaders/Effects/vfez_color_shadow.gdshaderinc
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
group_uniforms color_shadow;
|
||||
uniform float color_shadow_x: hint_range(-0.5, 0.5) = 0.1;
|
||||
uniform float color_shadow_y: hint_range(-0.5, 0.5) = 0.1;
|
||||
uniform float color_shadow_alpha: hint_range(0., 1.) = 0.5;
|
||||
uniform vec3 color_shadow_color: source_color = vec3(0.);
|
||||
group_uniforms;
|
||||
|
||||
vec4 shadow(vec4 color, sampler2D tex, vec2 uv)
|
||||
{
|
||||
vec2 shadowOffset = vec2(color_shadow_x, color_shadow_y);
|
||||
float shadowA = texture(tex, uv + shadowOffset).a;
|
||||
color.rgb *= 1. - (shadowA - color.a) * (1. - color.a);
|
||||
color.rgb += color_shadow_color * shadowA * (1. - color.a);
|
||||
color = clamp(color, 0., 1.);
|
||||
color.a = max(shadowA * color_shadow_alpha, color.a);
|
||||
return color;
|
||||
}
|
||||
48
VFEZ/Shaders/Effects/vfez_color_shine.gdshaderinc
Normal file
48
VFEZ/Shaders/Effects/vfez_color_shine.gdshaderinc
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
#ifndef VFEZ_UTILS
|
||||
#include "vfez_utils.gdshaderinc"
|
||||
#define VFEZ_UTILS
|
||||
#endif
|
||||
|
||||
group_uniforms color_shine;
|
||||
uniform vec4 color_shine_color: source_color = vec4(1.);
|
||||
uniform float color_shine_location: hint_range(0., 1.) = 0.5;
|
||||
uniform float color_shine_angle: hint_range(0.0, 6.2831) = 0.;
|
||||
uniform float color_shine_width: hint_range(0.0, 2.0) = 0.1;
|
||||
uniform float color_shine_glow: hint_range(0., 100., 1.) = 1.;
|
||||
uniform sampler2D color_shine_mask: source_color;
|
||||
uniform bool color_shine_mask_red_as_alpha;
|
||||
group_uniforms;
|
||||
|
||||
vec4 color_shine(vec4 color, vec2 uv)
|
||||
{
|
||||
if (color_shine_width == 0.)
|
||||
return color;
|
||||
|
||||
vec2 shine_uv = uv;
|
||||
shine_uv = rotate_uvs(shine_uv, color_shine_angle, vec2(1.), vec2(0.));
|
||||
|
||||
float shine_mask;
|
||||
|
||||
if (color_shine_mask_red_as_alpha)
|
||||
{
|
||||
shine_mask = texture(color_shine_mask, uv).r;
|
||||
}
|
||||
else
|
||||
{
|
||||
shine_mask = texture(color_shine_mask, uv).a;
|
||||
}
|
||||
|
||||
float current_distance_proj = (shine_uv.x + shine_uv.y) / 2.;
|
||||
float white_power = 1. -
|
||||
abs(current_distance_proj - color_shine_location) / color_shine_width;
|
||||
|
||||
|
||||
vec4 shine_color = color + color.a * white_power * color_shine_glow
|
||||
* max(sign(current_distance_proj - (color_shine_location - color_shine_width)), 0.)
|
||||
* max(sign(color_shine_location + color_shine_width - current_distance_proj), 0.)
|
||||
* color_shine_color * shine_mask;
|
||||
|
||||
color.rgb = shine_color.rgb;
|
||||
|
||||
return color;
|
||||
}
|
||||
10
VFEZ/Shaders/Effects/vfez_color_single.gdshaderinc
Normal file
10
VFEZ/Shaders/Effects/vfez_color_single.gdshaderinc
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
group_uniforms color_single;
|
||||
uniform vec3 color_single_color: source_color = vec3(1.);
|
||||
uniform float color_single_blend: hint_range(0.0, 1.0) = 1.0;
|
||||
group_uniforms;
|
||||
|
||||
vec3 color_single(vec3 color)
|
||||
{
|
||||
color = mix(color, color_single_color, color_single_blend);
|
||||
return color;
|
||||
}
|
||||
36
VFEZ/Shaders/Effects/vfez_color_toning.gdshaderinc
Normal file
36
VFEZ/Shaders/Effects/vfez_color_toning.gdshaderinc
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
#ifndef VFEZ_UTILS
|
||||
#include "vfez_utils.gdshaderinc"
|
||||
#define VFEZ_UTILS
|
||||
#endif
|
||||
|
||||
group_uniforms color_toning;
|
||||
uniform vec3 color_grading_light_tone: source_color;
|
||||
uniform vec3 color_grading_mid_tone: source_color;
|
||||
uniform vec3 color_grading_dark_tone: source_color;
|
||||
uniform float color_grading_mid_point: hint_range(0.0, 1.0) = 0.5;
|
||||
group_uniforms;
|
||||
|
||||
vec3 color_toning(vec4 color)
|
||||
{
|
||||
float luminance = get_color_luminance(color);
|
||||
|
||||
vec3 color_grading_dark_middle_mix = mix(
|
||||
color_grading_dark_tone,
|
||||
color_grading_mid_tone,
|
||||
luminance / color_grading_mid_point
|
||||
);
|
||||
|
||||
vec3 color_grading_middle_light_mix = mix(
|
||||
color_grading_mid_tone,
|
||||
color_grading_light_tone,
|
||||
(luminance - color_grading_mid_point) / (1.0 - color_grading_mid_point)
|
||||
);
|
||||
|
||||
color.rgb *= mix(
|
||||
color_grading_dark_middle_mix,
|
||||
color_grading_middle_light_mix,
|
||||
step(color_grading_mid_point, luminance)
|
||||
);
|
||||
|
||||
return color.rgb;
|
||||
}
|
||||
20
VFEZ/Shaders/Effects/vfez_glitch.gdshaderinc
Normal file
20
VFEZ/Shaders/Effects/vfez_glitch.gdshaderinc
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#ifndef VFEZ_UTILS
|
||||
#include "vfez_utils.gdshaderinc"
|
||||
#define VFEZ_UTILS
|
||||
#endif
|
||||
|
||||
group_uniforms glitch;
|
||||
uniform float glitch_amount: hint_range(0.0, 20.) = 3.;
|
||||
uniform float glitch_size: hint_range(0.25, 5.) = 1.;
|
||||
group_uniforms;
|
||||
|
||||
vec3 glitch(vec3 color, vec2 uv, sampler2D main_texture)
|
||||
{
|
||||
vec2 glitch_uv = uv - 0.5;
|
||||
float line_noise =
|
||||
pow(rand(floor(glitch_uv * vec2(24., 19.) * glitch_size) * 4.0, TIME), 3.0) * glitch_amount
|
||||
* pow(rand(floor(glitch_uv * vec2(38., 14.) * glitch_size) * 4.0, TIME), 3.0);
|
||||
|
||||
color = texture(main_texture, uv + vec2(line_noise * 0.02 * rand(vec2(2.0, 1.), TIME), 0)).rgb;
|
||||
return color;
|
||||
}
|
||||
23
VFEZ/Shaders/Effects/vfez_hsv_shift.gdshaderinc
Normal file
23
VFEZ/Shaders/Effects/vfez_hsv_shift.gdshaderinc
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
group_uniforms color_hsv_shift;
|
||||
uniform float h_shift: hint_range(0.0, 360.0) = 180;
|
||||
uniform float s_shift: hint_range(0.0, 2.) = 1.;
|
||||
uniform float v_shift: hint_range(0.0, 2.) = 1.;
|
||||
group_uniforms;
|
||||
|
||||
vec3 hsv_shift(vec3 color)
|
||||
{
|
||||
vec3 result_hsv = vec3(color.rgb);
|
||||
float cos_hsv = v_shift * s_shift * cos(h_shift * PI / 180.);
|
||||
float sin_hsv = v_shift * s_shift * sin(h_shift * PI / 180.);
|
||||
result_hsv.x = (.299 * v_shift + .701 * cos_hsv + .168 * sin_hsv) * color.x
|
||||
+ (.587 * v_shift - .587 * cos_hsv + .330 * sin_hsv) * color.y
|
||||
+ (.114 * v_shift - .114 * cos_hsv - .497 * sin_hsv) * color.z;
|
||||
result_hsv.y = (.299 * v_shift - .299 * cos_hsv - .328 * sin_hsv) *color.x
|
||||
+ (.587 * v_shift + .413 * cos_hsv + .035 * sin_hsv) * color.y
|
||||
+ (.114 * v_shift - .114 * cos_hsv + .292 * sin_hsv) * color.z;
|
||||
result_hsv.z = (.299 * v_shift - .3 * cos_hsv + 1.25 * sin_hsv) * color.x
|
||||
+ (.587 * v_shift - .588 * cos_hsv - 1.05 * sin_hsv) * color.y
|
||||
+ (.114 * v_shift + .886 * cos_hsv - .203 * sin_hsv) * color.z;
|
||||
color.rgb = result_hsv;
|
||||
return color.rgb;
|
||||
}
|
||||
35
VFEZ/Shaders/Effects/vfez_motion_blur.gdshaderinc
Normal file
35
VFEZ/Shaders/Effects/vfez_motion_blur.gdshaderinc
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
#ifndef VFEZ_UTILS
|
||||
#include "vfez_utils.gdshaderinc"
|
||||
#define VFEZ_UTILS
|
||||
#endif
|
||||
|
||||
group_uniforms motion_blur;
|
||||
uniform float motion_blur_angle: hint_range(-1., 1.) = 0.1;
|
||||
uniform float motion_blur_dist: hint_range(-3., 3.) = 1.25;
|
||||
group_uniforms;
|
||||
|
||||
vec3 motion_blur(vec3 color, vec2 uv, sampler2D main_texture)
|
||||
{
|
||||
float angle = motion_blur_angle * PI;
|
||||
float dist = motion_blur_dist * 0.005;
|
||||
color.rgb += texture(main_texture,
|
||||
uv + rotate_vec2(vec2(-dist, -dist), angle)).rgb;
|
||||
color.rgb += texture(main_texture,
|
||||
uv + rotate_vec2(vec2(-dist, -dist) * 2., angle)).rgb;
|
||||
color.rgb += texture(main_texture,
|
||||
uv + rotate_vec2(vec2(-dist, -dist) * 3., angle)).rgb;
|
||||
color.rgb += texture(main_texture,
|
||||
uv + rotate_vec2(vec2(-dist, -dist) * 4., angle)).rgb;
|
||||
|
||||
color.rgb += texture(main_texture,
|
||||
uv + rotate_vec2(vec2(dist, dist), angle)).rgb;
|
||||
color.rgb += texture(main_texture,
|
||||
uv + rotate_vec2(vec2(dist, dist) * 2., angle)).rgb;
|
||||
color.rgb += texture(main_texture,
|
||||
uv + rotate_vec2(vec2(dist, dist) * 3., angle)).rgb;
|
||||
color.rgb += texture(main_texture,
|
||||
uv + rotate_vec2(vec2(dist, dist) * 4., angle)).rgb;
|
||||
|
||||
color.rgb /= 9.;
|
||||
return color;
|
||||
}
|
||||
101
VFEZ/Shaders/Effects/vfez_outline.gdshaderinc
Normal file
101
VFEZ/Shaders/Effects/vfez_outline.gdshaderinc
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
#ifndef VFEZ_UTILS
|
||||
#include "vfez_utils.gdshaderinc"
|
||||
#define VFEZ_UTILS
|
||||
#endif
|
||||
|
||||
group_uniforms outline;
|
||||
uniform vec3 outline_color: source_color;
|
||||
uniform float outline_alpha: hint_range(0.0, 1.0) = 1.0;
|
||||
uniform float outline_glow: hint_range(1., 100, 1.) = 1.0;
|
||||
uniform float outline_width;
|
||||
uniform bool only_render_outline;
|
||||
group_uniforms;
|
||||
|
||||
group_uniforms outline.pixel_perfect;
|
||||
uniform bool use_pixel_perfect_outline;
|
||||
uniform int outline_pixel_width;
|
||||
group_uniforms;
|
||||
|
||||
group_uniforms outline.texture;
|
||||
uniform bool use_outline_texture;
|
||||
uniform sampler2D outline_texture;
|
||||
uniform vec2 outline_texture_scale = vec2(1.);
|
||||
uniform vec2 outline_texture_offset = vec2(0.);
|
||||
uniform vec2 outline_texture_scroll_speed = vec2(0.);
|
||||
group_uniforms;
|
||||
|
||||
group_uniforms outline.distortion;
|
||||
uniform bool use_outline_distortion;
|
||||
uniform sampler2D outline_distortion_texture;
|
||||
uniform vec2 outline_distortion_texture_scale = vec2(1.);
|
||||
uniform vec2 outline_distortion_texture_offset = vec2(0.);
|
||||
uniform vec2 outline_distortion_texture_scroll_speed = vec2(0.);
|
||||
uniform float outline_distortion_amount;
|
||||
group_uniforms;
|
||||
|
||||
vec4 outline(vec4 color, vec2 texture_pixel_size, vec2 uv, sampler2D tex)
|
||||
{
|
||||
float base_tex_a = texture(tex, uv).a;;
|
||||
|
||||
vec2 destUV;
|
||||
if (use_pixel_perfect_outline)
|
||||
{
|
||||
destUV = texture_pixel_size * float(outline_pixel_width);
|
||||
}
|
||||
else
|
||||
{
|
||||
destUV = texture_pixel_size * float(outline_width) * 200.;
|
||||
}
|
||||
|
||||
if (use_outline_distortion)
|
||||
{
|
||||
vec2 outlineDistUV = transform_uv(
|
||||
uv,
|
||||
outline_distortion_texture_scale,
|
||||
outline_distortion_texture_offset,
|
||||
true);
|
||||
|
||||
destUV = uv_distortion(destUV, outline_distortion_texture, outlineDistUV,
|
||||
outline_distortion_amount, outline_distortion_texture_scroll_speed, true);;
|
||||
|
||||
}
|
||||
|
||||
float left = texture(tex, uv + vec2(destUV.x, 0.)).a;
|
||||
float right = texture(tex, uv - vec2(destUV.x, 0.)).a;
|
||||
float bottom = texture(tex, uv + vec2(0., destUV.y)).a;
|
||||
float top = texture(tex, uv - vec2(0., destUV.y)).a;
|
||||
float result = left + right + bottom + top;
|
||||
|
||||
result = step(0.05, clamp(result, 0., 1.));
|
||||
|
||||
vec4 final_outline_color = vec4(outline_color, 1.0);
|
||||
|
||||
if (use_outline_texture)
|
||||
{
|
||||
vec2 outlineTexUV = transform_uv(
|
||||
uv,
|
||||
outline_texture_scale,
|
||||
outline_texture_offset,
|
||||
true);
|
||||
|
||||
outlineTexUV += mod(TIME * outline_texture_scroll_speed,vec2(1.));
|
||||
outlineTexUV = fract(outlineTexUV);
|
||||
final_outline_color *= texture(outline_texture, outlineTexUV);
|
||||
}
|
||||
|
||||
result *= (1. - color.a) * outline_alpha;
|
||||
vec4 outline = final_outline_color;
|
||||
outline.rgb *= outline_glow;
|
||||
outline.a = result;
|
||||
|
||||
if (only_render_outline)
|
||||
{
|
||||
color = outline;
|
||||
}
|
||||
else
|
||||
{
|
||||
color = mix(color, outline, result);
|
||||
}
|
||||
|
||||
return color;
|
||||
}
|
||||
40
VFEZ/Shaders/Effects/vfez_outline_inner.gdshaderinc
Normal file
40
VFEZ/Shaders/Effects/vfez_outline_inner.gdshaderinc
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
group_uniforms outline_inner;
|
||||
uniform bool only_render_inner_outline;
|
||||
uniform vec3 outline_inner_color: source_color;
|
||||
uniform float outline_inner_thickness: hint_range(0., 5.) = 1.;
|
||||
uniform float outline_inner_alpha: hint_range(0., 1.) = 1.;
|
||||
uniform float ouline_inner_glow: hint_range(1., 10.) = 1.;
|
||||
group_uniforms;
|
||||
|
||||
vec3 get_pixel(float offsetX, float offsetY, vec2 uv, sampler2D tex, vec2 texture_pixel_size)
|
||||
{
|
||||
return texture(tex, (uv + vec2(offsetX * texture_pixel_size.x, offsetY * texture_pixel_size.y))).rgb;
|
||||
}
|
||||
|
||||
|
||||
vec4 outline_inner(vec4 color, vec2 texture_pixel_size, vec2 uv, sampler2D tex)
|
||||
{
|
||||
vec3 innerT = abs(
|
||||
get_pixel(0., outline_inner_thickness, uv, tex, texture_pixel_size) -
|
||||
get_pixel(0., - outline_inner_thickness, uv, tex, texture_pixel_size)
|
||||
);
|
||||
|
||||
innerT += abs(
|
||||
get_pixel(outline_inner_thickness, 0., uv, tex, texture_pixel_size) -
|
||||
get_pixel(-outline_inner_thickness, 0., uv, tex, texture_pixel_size)
|
||||
);
|
||||
|
||||
if (only_render_inner_outline)
|
||||
{
|
||||
innerT *= color.a * outline_inner_alpha;
|
||||
color.rgb = length(innerT) * outline_inner_color * ouline_inner_glow;
|
||||
color.a = step(0.3, color.r + color.g + color.b);
|
||||
}
|
||||
else
|
||||
{
|
||||
innerT = innerT / 2.0 * color.a * outline_inner_alpha;
|
||||
color.rgb += length(innerT) * outline_inner_color * ouline_inner_glow;
|
||||
}
|
||||
|
||||
return color;
|
||||
}
|
||||
21
VFEZ/Shaders/Effects/vfez_particle_anim.gdshaderinc
Normal file
21
VFEZ/Shaders/Effects/vfez_particle_anim.gdshaderinc
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
group_uniforms particle.particle_anim;
|
||||
uniform int particles_anim_h_frames : hint_range(1, 128) = 1;
|
||||
uniform int particles_anim_v_frames : hint_range(1, 128) = 1;
|
||||
uniform bool particles_anim_loop;
|
||||
group_uniforms;
|
||||
|
||||
vec2 particle_anim(float instance_custom_z, vec2 uv)
|
||||
{
|
||||
float h_frames = float(particles_anim_h_frames);
|
||||
float v_frames = float(particles_anim_v_frames);
|
||||
float particle_total_frames = float(particles_anim_h_frames * particles_anim_v_frames);
|
||||
float particle_frame = floor(instance_custom_z * float(particle_total_frames));
|
||||
if (!particles_anim_loop) {
|
||||
particle_frame = clamp(particle_frame, 0.0, particle_total_frames - 1.0);
|
||||
} else {
|
||||
particle_frame = mod(particle_frame, particle_total_frames);
|
||||
}
|
||||
uv /= vec2(h_frames, v_frames);
|
||||
uv += vec2(mod(particle_frame, h_frames) / h_frames, floor((particle_frame + 0.5) / h_frames) / v_frames);
|
||||
return uv;
|
||||
}
|
||||
96
VFEZ/Shaders/Effects/vfez_utils.gdshaderinc
Normal file
96
VFEZ/Shaders/Effects/vfez_utils.gdshaderinc
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
// helper functions ------------------------------------------
|
||||
vec2 transform_uv(vec2 uv, vec2 scale, vec2 offset, bool fract_result)
|
||||
{
|
||||
uv = uv * scale + offset;
|
||||
if (fract_result)
|
||||
uv = fract(uv);
|
||||
return uv;
|
||||
}
|
||||
|
||||
vec2 uv_distortion(
|
||||
vec2 uv,
|
||||
sampler2D distortion_texture,
|
||||
vec2 distortion_uv,
|
||||
float distortion_amount,
|
||||
vec2 distortion_speed,
|
||||
bool fract_result)
|
||||
{
|
||||
distortion_uv += mod(TIME * distortion_speed, vec2(1.));
|
||||
if (fract_result)
|
||||
{
|
||||
distortion_uv = fract(distortion_uv);
|
||||
}
|
||||
|
||||
float distortAmount =
|
||||
(texture(distortion_texture, distortion_uv).r - 0.5) * 0.2 * distortion_amount;
|
||||
uv += vec2(1.) * distortAmount;
|
||||
return uv;
|
||||
}
|
||||
|
||||
vec2 uv_polar(vec2 uv, vec2 center)
|
||||
{
|
||||
vec2 dir = uv - center;
|
||||
float radius = length(dir) * 2.;
|
||||
float angle = atan(dir.y, dir.x) / (2. * PI);
|
||||
vec2 polarUV = vec2(angle, radius);
|
||||
//baseUV = mod(vec2(radius, angle), 1.0);
|
||||
return polarUV;
|
||||
}
|
||||
|
||||
vec2 rotate_vec2(vec2 vector, float angle)
|
||||
{
|
||||
float cosAngle = cos(angle);
|
||||
float sinAngle = sin(angle);
|
||||
vector = mat2(vec2(cosAngle, -sinAngle), vec2(sinAngle, cosAngle)) * vector;
|
||||
return vector;
|
||||
}
|
||||
|
||||
vec2 rotate_uvs(vec2 uv, float rotation, vec2 scale, vec2 offset)
|
||||
{
|
||||
vec2 center = vec2(0.5 * scale.x + offset.x, 0.5 * scale.y + offset.y);
|
||||
uv -= center;
|
||||
uv = rotate_vec2(uv, rotation);
|
||||
uv += center;
|
||||
return uv;
|
||||
}
|
||||
|
||||
vec4 sample_texture_with_scroll(sampler2D tex, vec2 uv, vec2 scroll_speed, float time)
|
||||
{
|
||||
uv.x += mod(time * scroll_speed.x, 1);
|
||||
uv.y += mod(time * scroll_speed.y, 1);
|
||||
if (scroll_speed != vec2(0.))
|
||||
uv = fract(uv);
|
||||
return texture(tex, uv);
|
||||
}
|
||||
|
||||
float rand(vec2 seed, float offset) {
|
||||
return mod(fract(sin(dot(seed, vec2(12.9898, 78.233))) * 43758.5453) + offset, 1.0);
|
||||
}
|
||||
|
||||
float rand_uncapped(vec2 seed, float offset) {
|
||||
return fract(sin(dot(seed, vec2(12.9898, 78.233))) * 43758.5453) + offset;
|
||||
}
|
||||
|
||||
float rand2(vec2 seed, float offset, float time) {
|
||||
return mod(
|
||||
fract(
|
||||
sin(
|
||||
dot(seed * floor(50. + mod(time, 1.0) * 12.), vec2(127.1, 311.7))
|
||||
) * 43758.5453123
|
||||
) + offset, 1.0);
|
||||
}
|
||||
|
||||
float remap_float(float inValue, float inMin, float inMax, float outMin, float outMax){
|
||||
return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin);
|
||||
}
|
||||
|
||||
float ease_out_quint(float x) {
|
||||
return 1. - pow(1. - x, 5.);
|
||||
}
|
||||
|
||||
float get_color_luminance(vec4 color)
|
||||
{
|
||||
float luminance = 0.3 * color.r + 0.59 * color.g + 0.11 * color.b;
|
||||
luminance *= color.a;
|
||||
return luminance;
|
||||
}
|
||||
18
VFEZ/Shaders/Effects/vfez_uv_fisheye.gdshaderinc
Normal file
18
VFEZ/Shaders/Effects/vfez_uv_fisheye.gdshaderinc
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
group_uniforms uv_fisheye;
|
||||
uniform float uv_fisheye_center_x: hint_range(0.0, 1.0) = 0.5;
|
||||
uniform float uv_fisheye_center_y: hint_range(0.0, 1.0) = 0.5;
|
||||
uniform float uv_fisheye_amount = 0.1;
|
||||
group_uniforms;
|
||||
|
||||
vec2 uv_fisheye(vec2 uv, vec2 main_texture_scale)
|
||||
{
|
||||
vec2 center = vec2(uv_fisheye_center_x * main_texture_scale.x,
|
||||
uv_fisheye_center_y * main_texture_scale.y);
|
||||
|
||||
float bind = length(center);
|
||||
vec2 dF = uv - center;
|
||||
float dFlen = length(dF);
|
||||
float fishInt = (PI / bind) * (uv_fisheye_amount + 0.001);
|
||||
uv = center + (dF / max(0.0001, dFlen)) * tan(dFlen * fishInt) * bind / tan(bind * fishInt);
|
||||
return uv;
|
||||
}
|
||||
15
VFEZ/Shaders/Effects/vfez_uv_handrawn.gdshaderinc
Normal file
15
VFEZ/Shaders/Effects/vfez_uv_handrawn.gdshaderinc
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
group_uniforms uv_handrawn;
|
||||
uniform float uv_handrawn_amount: hint_range(0.0, 40.0) = 10.;
|
||||
uniform float uv_handrawn_speed: hint_range(0.0, 30.0) = 5.;
|
||||
group_uniforms;
|
||||
|
||||
vec2 uv_handrawn(vec2 uv)
|
||||
{
|
||||
vec2 handrawnUV = uv;
|
||||
float handrawn_speed =
|
||||
floor(TIME * 20. * uv_handrawn_speed);
|
||||
handrawnUV.x = sin((handrawnUV.x * uv_handrawn_amount + handrawn_speed / 2.) * 4.);
|
||||
handrawnUV.y = sin((handrawnUV.y * uv_handrawn_amount + handrawn_speed / 2.) * 4.);
|
||||
uv = mix(uv, uv + handrawnUV, 0.0005 * uv_handrawn_amount);
|
||||
return uv;
|
||||
}
|
||||
16
VFEZ/Shaders/Effects/vfez_uv_pinch.gdshaderinc
Normal file
16
VFEZ/Shaders/Effects/vfez_uv_pinch.gdshaderinc
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
group_uniforms uv_pinch;
|
||||
uniform float uv_pinch_center_x: hint_range(0.0, 1.0) = 0.5;
|
||||
uniform float uv_pinch_center_y: hint_range(0.0, 1.0) = 0.5;
|
||||
uniform float uv_pinch_amount;
|
||||
group_uniforms;
|
||||
|
||||
vec2 uv_pinch(vec2 uv, vec2 main_texture_scale)
|
||||
{
|
||||
vec2 center = vec2(uv_pinch_center_x * main_texture_scale.x,
|
||||
uv_pinch_center_y * main_texture_scale.y);
|
||||
vec2 dP = uv - center;
|
||||
float pinchInt = (PI / length(center)) * (-uv_pinch_amount + 0.001);
|
||||
uv = center + normalize(dP) * atan(-length(dP) * pinchInt * 10.0)
|
||||
* 0.5 / atan(-pinchInt * 5.);
|
||||
return uv;
|
||||
}
|
||||
11
VFEZ/Shaders/Effects/vfez_uv_pixelate.gdshaderinc
Normal file
11
VFEZ/Shaders/Effects/vfez_uv_pixelate.gdshaderinc
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
group_uniforms uv_pixelate;
|
||||
uniform int uv_pixelate_size: hint_range(4, 512) = 32;
|
||||
group_uniforms;
|
||||
|
||||
vec2 uv_pixelate(vec2 uv, vec2 viewport_size)
|
||||
{
|
||||
float aspect_ratio = viewport_size.x / viewport_size.y;
|
||||
vec2 pixel_size = vec2(float(uv_pixelate_size), float(uv_pixelate_size) * aspect_ratio);
|
||||
uv = floor(uv * pixel_size) / pixel_size;
|
||||
return uv;
|
||||
}
|
||||
18
VFEZ/Shaders/Effects/vfez_uv_round_wave.gdshaderinc
Normal file
18
VFEZ/Shaders/Effects/vfez_uv_round_wave.gdshaderinc
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
group_uniforms uv_round_wave;
|
||||
uniform float uv_round_wave_strength: hint_range(0.0, 1.0) = 0.7;
|
||||
uniform float uv_round_wave_speed: hint_range(0.0, 5.0) = 2.;
|
||||
group_uniforms;
|
||||
|
||||
vec2 uv_round_wave(
|
||||
vec2 uv,
|
||||
vec2 main_texture_size,
|
||||
vec2 main_texture_scale)
|
||||
{
|
||||
float round_wave_x = 0.5 * main_texture_scale.x - uv.x;
|
||||
float round_wave_y = (0.5 * main_texture_scale.y - uv.y) *
|
||||
main_texture_size.y / main_texture_size.x;
|
||||
float ripple = -sqrt(round_wave_x * round_wave_x + round_wave_y * round_wave_y);
|
||||
uv += mod(sin((ripple + TIME * (uv_round_wave_speed/10.0)) / 0.015)
|
||||
* (uv_round_wave_strength /10.0), 1.0);
|
||||
return uv;
|
||||
}
|
||||
14
VFEZ/Shaders/Effects/vfez_uv_shake.gdshaderinc
Normal file
14
VFEZ/Shaders/Effects/vfez_uv_shake.gdshaderinc
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
group_uniforms uv_shake;
|
||||
uniform float uv_shake_speed: hint_range(0.0, 50.0) = 20.;
|
||||
uniform float uv_shake_x: hint_range(-15., 15) = 5;
|
||||
uniform float uv_shake_y: hint_range(-15., 15) = 4;
|
||||
group_uniforms;
|
||||
|
||||
vec2 uv_shake(
|
||||
vec2 uv)
|
||||
{
|
||||
float x_shake = sin(TIME * uv_shake_speed * 50.) * uv_shake_x;
|
||||
float y_shake = cos(TIME * uv_shake_speed * 50.) * uv_shake_y;
|
||||
uv += vec2(x_shake * 0.012, y_shake * 0.01);
|
||||
return uv;
|
||||
}
|
||||
26
VFEZ/Shaders/Effects/vfez_uv_twist.gdshaderinc
Normal file
26
VFEZ/Shaders/Effects/vfez_uv_twist.gdshaderinc
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
group_uniforms uv_twist;
|
||||
uniform float uv_twist_amount: hint_range(0.0, 3.1415) = 1.;
|
||||
uniform float uv_twist_pos_x: hint_range(0.0, 1.0) = 0.5;
|
||||
uniform float uv_twist_pos_y: hint_range(0.0, 1.0) = 0.5;
|
||||
uniform float uv_twist_radius: hint_range(0.0, 3.0) = 0.75;
|
||||
group_uniforms;
|
||||
|
||||
vec2 uv_twist(
|
||||
vec2 uv,
|
||||
vec2 main_texture_scale)
|
||||
{
|
||||
vec2 twistUV = uv - vec2(uv_twist_pos_x * main_texture_scale.x,
|
||||
uv_twist_pos_y * main_texture_scale.y);
|
||||
float twist_radius = uv_twist_radius *
|
||||
(main_texture_scale.x + main_texture_scale.y) / 2.;
|
||||
float percent = (twist_radius - length(twistUV)) / twist_radius;
|
||||
float theta = percent * percent * (2.0 * sin(uv_twist_amount)) * 8.0;
|
||||
float s = sin(theta);
|
||||
float c = cos(theta);
|
||||
float beta = max(sign(twist_radius - length(twistUV)), 0.);
|
||||
twistUV = vec2(dot(twistUV, vec2(c, -s)), dot(twistUV, vec2(s, c))) * beta + twistUV * (1. - beta);
|
||||
twistUV += vec2(uv_twist_pos_x * main_texture_scale.x,
|
||||
uv_twist_pos_y * main_texture_scale.y);
|
||||
uv = twistUV;
|
||||
return uv;
|
||||
}
|
||||
22
VFEZ/Shaders/Effects/vfez_uv_wave.gdshaderinc
Normal file
22
VFEZ/Shaders/Effects/vfez_uv_wave.gdshaderinc
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
group_uniforms uv_wave;
|
||||
uniform float uv_wave_amount: hint_range(0.0, 25.0) = 7.;
|
||||
uniform float uv_wave_speed: hint_range(0.0, 25.0) = 10.;
|
||||
uniform float uv_wave_strength: hint_range(0.0, 25.0) = 7.5;
|
||||
uniform float uv_wave_x: hint_range(0.0, 1.0) = 0.;
|
||||
uniform float uv_wave_y: hint_range(0.0, 1.0) = 0.5;
|
||||
group_uniforms;
|
||||
|
||||
vec2 uv_wave(
|
||||
vec2 uv,
|
||||
vec2 viewport_size,
|
||||
vec2 main_texture_scale)
|
||||
{
|
||||
vec2 waveUV = vec2(uv_wave_x * main_texture_scale.x,
|
||||
uv_wave_y * main_texture_scale.y) - uv;
|
||||
waveUV.x *= viewport_size.x / viewport_size.y;
|
||||
float ang_wave =
|
||||
(sqrt(dot(waveUV, waveUV)) * uv_wave_amount)
|
||||
- mod(TIME * uv_wave_speed, 360.0);
|
||||
uv = uv + normalize(waveUV) * sin(ang_wave) * (uv_wave_strength / 1000.);
|
||||
return uv;
|
||||
}
|
||||
31
VFEZ/Shaders/Effects/vfez_uv_wind.gdshaderinc
Normal file
31
VFEZ/Shaders/Effects/vfez_uv_wind.gdshaderinc
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
group_uniforms uv_wind;
|
||||
uniform float uv_wind_speed: hint_range(0., 50.) = 2.;
|
||||
uniform float uv_wind_amount: hint_range(0, 50) = 20;
|
||||
uniform float uv_wind_vertical_ratio: hint_range(0.0, 1.0) = 1.;
|
||||
uniform vec2 uv_radial_bend_center = vec2(0.5, 0.9);
|
||||
uniform bool uv_wind_animate_manual;
|
||||
uniform float uv_wind_manual_anim: hint_range(-1, 1) = 1;
|
||||
uniform float uv_wind_radial_bend: hint_range(0.0, 5.0) = 0.1;
|
||||
group_uniforms;
|
||||
|
||||
vec2 uv_wind(vec2 uv)
|
||||
{
|
||||
float wind_offset;
|
||||
if (uv_wind_animate_manual)
|
||||
{
|
||||
wind_offset = uv_wind_manual_anim;
|
||||
}
|
||||
else
|
||||
{
|
||||
wind_offset = sin(TIME * uv_wind_speed * 10.);
|
||||
}
|
||||
|
||||
uv.x = mix(uv.x, uv.x + uv_wind_amount * 0.01 * wind_offset,
|
||||
abs(uv_wind_vertical_ratio - uv.y));
|
||||
|
||||
vec2 delta = uv - uv_radial_bend_center;
|
||||
float delta2 = dot(delta, delta);
|
||||
float delta_offset = delta2 * wind_offset;
|
||||
uv = uv + vec2(delta.y, - delta.x) * delta_offset * uv_wind_radial_bend;
|
||||
return uv;
|
||||
}
|
||||
15
VFEZ/Shaders/Effects/vfez_uv_wrap.gdshaderinc
Normal file
15
VFEZ/Shaders/Effects/vfez_uv_wrap.gdshaderinc
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
group_uniforms uv_wrap;
|
||||
uniform float uv_wrap_strength: hint_range(0.0, 0.1) = 0.025;
|
||||
uniform float uv_wrap_speed: hint_range(0.0, 25.) = 8;
|
||||
uniform float uv_wrap_scale: hint_range(0.05, 3.) = 0.5;
|
||||
group_uniforms;
|
||||
|
||||
vec2 uv_wrap(vec2 uv, vec2 main_texture_scale)
|
||||
{
|
||||
vec2 norm_uv = uv / main_texture_scale;
|
||||
float x_wrap = TIME * uv_wrap_speed + norm_uv.x * TAU / uv_wrap_scale;
|
||||
float y_wrap = TIME * uv_wrap_speed + norm_uv.y * TAU / uv_wrap_scale;
|
||||
vec2 wrap = vec2(sin(x_wrap), cos(y_wrap)) * uv_wrap_strength;
|
||||
uv += wrap;
|
||||
return uv;
|
||||
}
|
||||
13
VFEZ/Shaders/Effects/vfez_uv_zoom.gdshaderinc
Normal file
13
VFEZ/Shaders/Effects/vfez_uv_zoom.gdshaderinc
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
group_uniforms uv_zoom;
|
||||
uniform vec2 uv_zoom_center = vec2(0.5);
|
||||
uniform float uv_zoom_amount: hint_range(0.1, 5.) = 0.5;
|
||||
group_uniforms;
|
||||
|
||||
vec2 uv_zoom(vec2 uv, vec2 main_texture_scale)
|
||||
{
|
||||
vec2 norm_center = uv_zoom_center / main_texture_scale;
|
||||
uv -= norm_center;
|
||||
uv = uv * uv_zoom_amount;
|
||||
uv += norm_center;
|
||||
return uv;
|
||||
}
|
||||
18
VFEZ/Shaders/Effects/vfez_vertex_expand.gdshaderinc
Normal file
18
VFEZ/Shaders/Effects/vfez_vertex_expand.gdshaderinc
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
group_uniforms vertex_expand;
|
||||
uniform vec3 vertex_expand_center = vec3(0.);
|
||||
uniform bool vertex_expand_ignore_center_vertical = false;
|
||||
uniform float vertex_expand_amount: hint_range(0.0, 10.) = 0.5;
|
||||
group_uniforms;
|
||||
|
||||
vec3 vertex_expand(
|
||||
vec3 vertex)
|
||||
{
|
||||
vec3 final_expand_center = vertex_expand_center;
|
||||
if (vertex_expand_ignore_center_vertical)
|
||||
{
|
||||
final_expand_center.z = vertex.z;
|
||||
}
|
||||
vec3 expand_dir = normalize(vertex - final_expand_center);
|
||||
vertex += expand_dir * vertex_expand_amount;
|
||||
return vertex;
|
||||
}
|
||||
18
VFEZ/Shaders/Effects/vfez_vertex_offset.gdshaderinc
Normal file
18
VFEZ/Shaders/Effects/vfez_vertex_offset.gdshaderinc
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
group_uniforms vertex_offset;
|
||||
uniform sampler2D vertex_offset_texture: source_color;
|
||||
uniform float vertex_offset_amount: hint_range(0.0, 2.) = 0.5;
|
||||
uniform float vertex_offset_power: hint_range(0.01, 10.) = 1.;
|
||||
uniform vec2 vertex_offset_speed;
|
||||
group_uniforms;
|
||||
|
||||
vec3 vertex_offset(
|
||||
vec3 vertex,
|
||||
vec3 normal,
|
||||
vec2 uv)
|
||||
{
|
||||
vec2 offsetUV = uv;
|
||||
offsetUV += mod(TIME * vertex_offset_speed, 1.0);
|
||||
float offset = textureLod(vertex_offset_texture, offsetUV, 0.).r;
|
||||
vertex = vertex + normal * vertex_offset_amount * pow(offset, vertex_offset_power);
|
||||
return vertex;
|
||||
}
|
||||
64
VFEZ/Shaders/vfez_2d_example.gdshader
Normal file
64
VFEZ/Shaders/vfez_2d_example.gdshader
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
// this code servers as an example VFEZ2D shader
|
||||
// that uses the VFEZ2D template. Files like this are
|
||||
// automatically generated using the VFEZMaterial but you
|
||||
// can also create them manually like the example below.
|
||||
|
||||
shader_type canvas_item;
|
||||
|
||||
#define BLEND_MIX
|
||||
//#define BLEND_ADD
|
||||
//#define BLEND_SUB
|
||||
//#define BLEND_MUL
|
||||
//#define BLEND_PREMUL_ALPHA
|
||||
|
||||
// #define UNSHADED
|
||||
// #define LIGHT_ONLY
|
||||
|
||||
#define UV_POLAR
|
||||
#define UV_DISTORTION
|
||||
#define UV_ROTATION
|
||||
#define UV_PIXELATE
|
||||
#define UV_TWIST
|
||||
#define UV_FISHEYE
|
||||
#define UV_PINCH
|
||||
#define UV_HANDRAWN
|
||||
#define UV_SHAKE
|
||||
#define UV_WAVE
|
||||
#define UV_ROUND_WAVE
|
||||
#define UV_WIND
|
||||
#define UV_WRAP
|
||||
#define UV_ZOOM
|
||||
|
||||
#define COLOR_SINGLE
|
||||
#define COLOR_OVERLAY_TEXTURE
|
||||
#define OUTLINE
|
||||
#define OUTLINE_INNER
|
||||
|
||||
#define ALPHA_DISOLVE
|
||||
#define CHROMATIC_ABERRATION
|
||||
#define MOTION_BLUR
|
||||
#define GLITCH
|
||||
#define COLOR_GRADIENT
|
||||
#define COLOR_RADIAL_GRADIENT
|
||||
#define COLOR_TONING
|
||||
#define COLOR_RAMP
|
||||
#define COLOR_CHANGE
|
||||
#define COLOR_GHOST
|
||||
#define COLOR_HOLOGRAM
|
||||
#define COLOR_POSTERIZE
|
||||
#define COLOR_NEGATIVE
|
||||
#define COLOR_GLOW
|
||||
#define COLOR_HSV_SHIFT
|
||||
#define COLOR_SHADOW
|
||||
#define COLOR_GREYSCALE
|
||||
|
||||
#define ALPHA_MASK
|
||||
#define ALPHA_REMAP
|
||||
#define ALPHA_CUTOFF
|
||||
#define ALPHA_CLIP
|
||||
#define ALPHA_RADIAL_CLIP
|
||||
#define ALPHA_FLICKER
|
||||
|
||||
#define PARTICLE_ANIM
|
||||
|
||||
#include "vfez_2d_template.gdshaderinc"
|
||||
753
VFEZ/Shaders/vfez_2d_template.gdshaderinc
Normal file
753
VFEZ/Shaders/vfez_2d_template.gdshaderinc
Normal file
|
|
@ -0,0 +1,753 @@
|
|||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// THE CODE BELOW IS NOT INTENDED TO BE CHANGED MANUALLY.
|
||||
// MANUAL CHANGES MIGHT CAUSE THE VFEZ MATERIAL TO WORK INCORRECTLY.
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
// shader code starts here -----------------------------------------------
|
||||
|
||||
#include "Effects/vfez_utils.gdshaderinc"
|
||||
|
||||
#if defined(UNSHADED)
|
||||
render_mode unshaded;
|
||||
#elif defined(LIGHT_ONLY)
|
||||
render_mode light_only;
|
||||
#endif
|
||||
|
||||
#if defined(BLEND_MIX)
|
||||
render_mode blend_mix;
|
||||
#elif defined(BLEND_ADD)
|
||||
render_mode blend_add;
|
||||
#elif defined(BLEND_SUB)
|
||||
render_mode blend_sub;
|
||||
#elif defined(BLEND_MUL)
|
||||
render_mode blend_mul;
|
||||
#elif defined(BLEND_PREMUL_ALPHA)
|
||||
render_mode blend_premul_alpha;
|
||||
#endif
|
||||
|
||||
group_uniforms base;
|
||||
uniform vec2 texture_scale = vec2(1.);
|
||||
uniform vec2 texture_offset = vec2(0.);
|
||||
uniform vec2 texture_scroll_speed = vec2(0.);
|
||||
uniform bool replicate_on_scale = true;
|
||||
uniform vec4 texture_color: source_color = vec4(1.);
|
||||
uniform float texture_alpha: hint_range(0.0, 1.0) = 1.;
|
||||
uniform bool texture_red_as_alpha = false;
|
||||
uniform bool premultiply_color = false;
|
||||
uniform bool premultiply_alpha = false;
|
||||
uniform float contrast: hint_range(0.0, 10) = 1.;
|
||||
uniform float brightness: hint_range(-1., 1.) = 0.;
|
||||
group_uniforms;
|
||||
|
||||
group_uniforms rect_size;
|
||||
uniform float rect_size_ratio: hint_range(1.0, 5.0) = 1.0;
|
||||
group_uniforms;
|
||||
|
||||
group_uniforms uv_polar;
|
||||
uniform bool use_uv_polar = false;
|
||||
#if defined(UV_POLAR)
|
||||
uniform vec2 uv_polar_center = vec2(0.5);
|
||||
uniform bool distortion_uses_uv_polar = false;
|
||||
#endif
|
||||
group_uniforms;
|
||||
|
||||
group_uniforms uv_distortion;
|
||||
uniform bool use_uv_distortion;
|
||||
#if defined(UV_DISTORTION)
|
||||
uniform sampler2D distortion_tex: source_color;
|
||||
uniform vec2 distortion_tex_scale = vec2(1.);
|
||||
uniform vec2 distortion_tex_offset = vec2(0.);
|
||||
uniform float distortion_amount: hint_range(0.0, 10) = 0.0;
|
||||
uniform vec2 distortion_speed = vec2(0.1);
|
||||
#endif
|
||||
group_uniforms;
|
||||
|
||||
group_uniforms uv_rotation;
|
||||
uniform bool use_uv_rotation;
|
||||
#if defined(UV_ROTATION)
|
||||
uniform float uv_rotation_offset: hint_range(0.0, 6.28318530718) = 0.;
|
||||
uniform float uv_rotation_speed = 0.;
|
||||
#endif
|
||||
group_uniforms;
|
||||
|
||||
group_uniforms uv_pixelate;
|
||||
uniform bool use_uv_pixelate = false;
|
||||
group_uniforms;
|
||||
#if defined(UV_PIXELATE)
|
||||
#include "Effects/vfez_uv_pixelate.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms uv_twist;
|
||||
uniform bool use_uv_twist = false;
|
||||
group_uniforms;
|
||||
#if defined(UV_TWIST)
|
||||
#include "Effects/vfez_uv_twist.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms uv_fisheye;
|
||||
uniform bool use_uv_fisheye;
|
||||
group_uniforms;
|
||||
#if defined(UV_FISHEYE)
|
||||
#include "Effects/vfez_uv_fisheye.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms uv_pinch;
|
||||
uniform bool use_uv_pinch;
|
||||
group_uniforms;
|
||||
#if defined(UV_PINCH)
|
||||
#include "Effects/vfez_uv_pinch.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms uv_handrawn;
|
||||
uniform bool use_uv_handrawn = false;
|
||||
group_uniforms;
|
||||
#if defined(UV_HANDRAWN)
|
||||
#include "Effects/vfez_uv_handrawn.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms uv_shake;
|
||||
uniform bool use_uv_shake = false;
|
||||
group_uniforms;
|
||||
#if defined(UV_SHAKE)
|
||||
#include "Effects/vfez_uv_shake.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms uv_wave;
|
||||
uniform bool use_uv_wave = false;
|
||||
group_uniforms;
|
||||
#if defined(UV_WAVE)
|
||||
#include "Effects/vfez_uv_wave.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms uv_round_wave;
|
||||
uniform bool use_uv_round_wave = false;
|
||||
group_uniforms;
|
||||
#if defined(UV_ROUND_WAVE)
|
||||
#include "Effects/vfez_uv_round_wave.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms uv_wind;
|
||||
uniform bool use_uv_wind = false;
|
||||
group_uniforms;
|
||||
#if defined(UV_WIND)
|
||||
#include "Effects/vfez_uv_wind.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms uv_wrap;
|
||||
uniform bool use_uv_wrap = false;
|
||||
group_uniforms;
|
||||
#if defined(UV_WRAP)
|
||||
#include "Effects/vfez_uv_wrap.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms uv_zoom;
|
||||
uniform bool use_uv_zoom = false;
|
||||
group_uniforms;
|
||||
#if defined(UV_ZOOM)
|
||||
#include "Effects/vfez_uv_zoom.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms color_single;
|
||||
uniform bool use_color_single;
|
||||
group_uniforms;
|
||||
#if defined(COLOR_SINGLE)
|
||||
#include "Effects/vfez_color_single.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms color_overlay_texture;
|
||||
uniform bool use_color_overlay_texture;
|
||||
group_uniforms;
|
||||
#if defined(COLOR_OVERLAY_TEXTURE)
|
||||
#include "Effects/vfez_color_overlay_texture.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms outline;
|
||||
uniform bool use_outline;
|
||||
group_uniforms;
|
||||
#if defined(OUTLINE)
|
||||
#include "Effects/vfez_outline.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms outline_inner;
|
||||
uniform bool use_outline_inner;
|
||||
group_uniforms;
|
||||
#if defined(OUTLINE_INNER)
|
||||
#include "Effects/vfez_outline_inner.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms alpha_disolve;
|
||||
uniform bool use_alpha_disolve = false;
|
||||
group_uniforms;
|
||||
#if defined(ALPHA_DISOLVE)
|
||||
#include "Effects/vfez_alpha_disolve.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms chromatic_aberration;
|
||||
uniform bool use_chromatic_aberration;
|
||||
group_uniforms;
|
||||
#if defined(CHROMATIC_ABERRATION)
|
||||
#include "Effects/vfez_chromatic_aberration.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms motion_blur;
|
||||
uniform bool use_motion_blur = false;
|
||||
group_uniforms;
|
||||
#if defined(MOTION_BLUR)
|
||||
#include "Effects/vfez_motion_blur.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms glitch;
|
||||
uniform bool use_glitch = false;
|
||||
group_uniforms;
|
||||
#if defined(GLITCH)
|
||||
#include "Effects/vfez_glitch.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms color_gradient;
|
||||
uniform bool use_color_gradient = false;
|
||||
group_uniforms;
|
||||
#if defined(COLOR_GRADIENT)
|
||||
#include "Effects/vfez_color_gradient.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms color_radial_gradient;
|
||||
uniform bool use_color_radial_gradient = false;
|
||||
group_uniforms;
|
||||
#if defined(COLOR_RADIAL_GRADIENT)
|
||||
#include "Effects/vfez_color_radial_gradient.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms color_toning;
|
||||
uniform bool use_color_toning = false;
|
||||
group_uniforms;
|
||||
#if defined(COLOR_TONING)
|
||||
#include "Effects/vfez_color_toning.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms color_ramp;
|
||||
uniform bool use_color_ramp = false;
|
||||
group_uniforms;
|
||||
#if defined(COLOR_RAMP)
|
||||
#include "Effects/vfez_color_ramp.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms color_change;
|
||||
uniform bool use_color_change = false;
|
||||
group_uniforms;
|
||||
#if defined(COLOR_CHANGE)
|
||||
#include "Effects/vfez_color_change.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms color_ghost;
|
||||
uniform bool use_color_ghost = false;
|
||||
group_uniforms;
|
||||
#if defined(COLOR_GHOST)
|
||||
#include "Effects/vfez_color_ghost.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms color_hologram;
|
||||
uniform bool use_color_hologram = false;
|
||||
group_uniforms;
|
||||
#if defined(COLOR_HOLOGRAM)
|
||||
#include "Effects/vfez_color_hologram.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms color_posterize;
|
||||
uniform bool use_color_posterize = false;
|
||||
group_uniforms;
|
||||
#if defined(COLOR_POSTERIZE)
|
||||
#include "Effects/vfez_color_posterize.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms color_negative;
|
||||
uniform bool use_color_negative;
|
||||
group_uniforms;
|
||||
#if defined(COLOR_NEGATIVE)
|
||||
#include "Effects/vfez_color_negative.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms color_glow;
|
||||
uniform bool use_color_glow = false;
|
||||
group_uniforms;
|
||||
#if defined(COLOR_GLOW)
|
||||
#include "Effects/vfez_color_glow.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms color_hsv_shift;
|
||||
uniform bool use_color_hsv_shift = false;
|
||||
group_uniforms;
|
||||
#if defined(COLOR_HSV_SHIFT)
|
||||
#include "Effects/vfez_hsv_shift.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms color_shadow;
|
||||
uniform bool use_color_shadow = false;
|
||||
group_uniforms;
|
||||
#if defined(COLOR_SHADOW)
|
||||
#include "Effects/vfez_color_shadow.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms color_greyscale;
|
||||
uniform bool use_color_greyscale= false;
|
||||
group_uniforms;
|
||||
#if defined(COLOR_GREYSCALE)
|
||||
#include "Effects/vfez_color_greyscale.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms color_shine;
|
||||
uniform bool use_color_shine= false;
|
||||
group_uniforms;
|
||||
#if defined(COLOR_SHINE)
|
||||
#include "Effects/vfez_color_shine.gdshaderinc"
|
||||
#endif
|
||||
|
||||
|
||||
group_uniforms alpha_mask;
|
||||
uniform bool use_alpha_mask = false;
|
||||
group_uniforms;
|
||||
#if defined(ALPHA_MASK)
|
||||
#include "Effects/vfez_alpha_mask.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms alpha_remap;
|
||||
uniform bool use_alpha_remap = false;
|
||||
group_uniforms alpha_remap;
|
||||
#if defined(ALPHA_REMAP)
|
||||
#include "Effects/vfez_alpha_remap.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms alpha_cutoff;
|
||||
uniform bool use_alpha_cutoff = false;
|
||||
group_uniforms;
|
||||
#if defined(ALPHA_CUTOFF)
|
||||
#include "Effects/vfez_alpha_cutoff.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms alpha_clip;
|
||||
uniform bool use_alpha_clip = false;
|
||||
group_uniforms;
|
||||
#if defined(ALPHA_CLIP)
|
||||
#include "Effects/vfez_alpha_clip.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms alpha_radial_clip;
|
||||
uniform bool use_alpha_radial_clip = false;
|
||||
group_uniforms;
|
||||
#if defined(ALPHA_RADIAL_CLIP)
|
||||
#include "Effects/vfez_alpha_radial_clip.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms alpha_flicker;
|
||||
uniform bool use_alpha_flicker = false;
|
||||
group_uniforms;
|
||||
#if defined(ALPHA_FLICKER)
|
||||
#include "Effects/vfez_alpha_flicker.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms particle.particle_anim;
|
||||
uniform bool use_particle_anim = false;
|
||||
group_uniforms;
|
||||
|
||||
#if defined(PARTICLE_ANIM)
|
||||
#include "Effects/vfez_particle_anim.gdshaderinc"
|
||||
#endif
|
||||
|
||||
void vertex() {
|
||||
#if defined(PARTICLE_ANIM)
|
||||
if (use_particle_anim)
|
||||
{
|
||||
UV = particle_anim(INSTANCE_CUSTOM.z, UV);
|
||||
}
|
||||
#endif
|
||||
|
||||
VERTEX += VERTEX * (rect_size_ratio - 1.0);
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
|
||||
vec2 startUV = UV * rect_size_ratio + vec2(-rect_size_ratio * 0.5 + 0.5);
|
||||
vec2 baseUV = startUV;
|
||||
|
||||
#if defined(UV_POLAR)
|
||||
if (use_uv_polar)
|
||||
{
|
||||
baseUV = uv_polar(baseUV, uv_polar_center);
|
||||
}
|
||||
#endif
|
||||
|
||||
baseUV = transform_uv(
|
||||
baseUV,
|
||||
texture_scale,
|
||||
texture_offset,
|
||||
replicate_on_scale);
|
||||
|
||||
#if defined(UV_DISTORTION)
|
||||
if (use_uv_distortion && distortion_amount > 0.)
|
||||
{
|
||||
vec2 distortionUV = startUV;
|
||||
distortionUV = transform_uv(
|
||||
distortionUV,
|
||||
distortion_tex_scale,
|
||||
distortion_tex_offset,
|
||||
true);
|
||||
|
||||
#if defined(UV_POLAR)
|
||||
if (use_uv_polar && distortion_uses_uv_polar)
|
||||
{
|
||||
distortionUV = uv_polar(distortionUV, uv_polar_center);
|
||||
}
|
||||
#endif
|
||||
|
||||
baseUV = uv_distortion(baseUV, distortion_tex, distortionUV, distortion_amount, distortion_speed, true);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(UV_ROTATION)
|
||||
if (use_uv_rotation)
|
||||
{
|
||||
baseUV = rotate_uvs(
|
||||
baseUV,
|
||||
uv_rotation_offset + mod(uv_rotation_speed * TIME, TAU),
|
||||
texture_scale,
|
||||
texture_offset);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(UV_PIXELATE)
|
||||
if (use_uv_pixelate)
|
||||
{
|
||||
vec2 texture_size = 1. / TEXTURE_PIXEL_SIZE;
|
||||
baseUV = uv_pixelate(baseUV, texture_size);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(UV_TWIST)
|
||||
if (use_uv_twist)
|
||||
{
|
||||
baseUV = uv_twist(baseUV, texture_scale);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined (UV_FISHEYE)
|
||||
if (use_uv_fisheye)
|
||||
{
|
||||
baseUV = uv_fisheye(baseUV, texture_scale);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(UV_PINCH)
|
||||
if (use_uv_pinch)
|
||||
{
|
||||
baseUV = uv_pinch(baseUV, texture_scale);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(UV_HANDRAWN)
|
||||
if (use_uv_handrawn)
|
||||
{
|
||||
baseUV = uv_handrawn(baseUV);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(UV_SHAKE)
|
||||
if (use_uv_shake)
|
||||
{
|
||||
baseUV = uv_shake(baseUV);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(UV_WAVE)
|
||||
if (use_uv_wave)
|
||||
{
|
||||
vec2 texture_size = 1. / TEXTURE_PIXEL_SIZE;
|
||||
baseUV = uv_wave(baseUV, texture_size, texture_scale);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(UV_ROUND_WAVE)
|
||||
if (use_uv_round_wave)
|
||||
{
|
||||
vec2 main_tex_size = vec2(textureSize(TEXTURE, 0));
|
||||
baseUV = uv_round_wave(baseUV, main_tex_size, texture_scale);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(UV_WIND)
|
||||
if (use_uv_wind)
|
||||
{
|
||||
baseUV = uv_wind(baseUV);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(UV_WRAP)
|
||||
if (use_uv_wrap)
|
||||
{
|
||||
baseUV = uv_wrap(baseUV, texture_scale);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(UV_ZOOM)
|
||||
if (use_uv_zoom)
|
||||
{
|
||||
baseUV = uv_zoom(baseUV, texture_scale);
|
||||
}
|
||||
#endif
|
||||
|
||||
vec4 color = sample_texture_with_scroll(
|
||||
TEXTURE,
|
||||
baseUV,
|
||||
texture_scroll_speed,
|
||||
TIME);
|
||||
|
||||
if (texture_red_as_alpha)
|
||||
{
|
||||
color = vec4(texture_color.rgb * color.rgb, color.r);
|
||||
}
|
||||
else
|
||||
{
|
||||
color *= texture_color;
|
||||
}
|
||||
|
||||
bool apply_contrast = contrast != 1. || brightness != 0.;
|
||||
|
||||
if (apply_contrast)
|
||||
{
|
||||
if (texture_red_as_alpha)
|
||||
{
|
||||
color.a = clamp(
|
||||
(color.a - 0.5) * contrast + 0.5 + brightness,
|
||||
0.,
|
||||
1.);
|
||||
}
|
||||
else
|
||||
{
|
||||
color.rgb = vec3(
|
||||
max(0, (color.r - 0.5) * contrast + 0.5 + brightness),
|
||||
max(0, (color.g - 0.5) * contrast + 0.5 + brightness),
|
||||
max(0, (color.b - 0.5) * contrast + 0.5 + brightness)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------
|
||||
|
||||
// apply premultiply color
|
||||
if (premultiply_color)
|
||||
{
|
||||
float luminance = get_color_luminance(color);
|
||||
color.a = min(luminance, color.a);
|
||||
}
|
||||
|
||||
/// apply premultiply alpha
|
||||
if (premultiply_alpha)
|
||||
{
|
||||
color.rgb *= color.a;
|
||||
}
|
||||
|
||||
#if defined(COLOR_SINGLE)
|
||||
if (use_color_single)
|
||||
{
|
||||
color.rgb = color_single(color.rgb);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(COLOR_OVERLAY_TEXTURE)
|
||||
if (use_color_overlay_texture)
|
||||
{
|
||||
color = color_overlay_texture(color, baseUV);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(OUTLINE)
|
||||
if (use_outline)
|
||||
{
|
||||
color = outline(color, TEXTURE_PIXEL_SIZE, baseUV, TEXTURE);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(OUTLINE_INNER)
|
||||
if (use_outline_inner)
|
||||
{
|
||||
color = outline_inner(color, TEXTURE_PIXEL_SIZE, baseUV, TEXTURE);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(ALPHA_DISOLVE)
|
||||
if (use_alpha_disolve)
|
||||
{
|
||||
color = alpha_disolve(color, color.a, COLOR.a, baseUV, false);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CHROMATIC_ABERRATION)
|
||||
if (use_chromatic_aberration)
|
||||
{
|
||||
color = chromatic_aberration(color, baseUV, TEXTURE);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(MOTION_BLUR)
|
||||
if (use_motion_blur)
|
||||
{
|
||||
color.rgb = motion_blur(color.rgb, baseUV, TEXTURE);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(GLITCH)
|
||||
if (use_glitch)
|
||||
{
|
||||
color.rgb = glitch(color.rgb, baseUV, TEXTURE);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(COLOR_GRADIENT)
|
||||
if (use_color_gradient)
|
||||
{
|
||||
color.rgba = color_gradient(color, baseUV, texture_scale);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(COLOR_RADIAL_GRADIENT)
|
||||
|
||||
if (use_color_radial_gradient)
|
||||
{
|
||||
vec2 main_tex_size = vec2(textureSize(TEXTURE, 0));
|
||||
color.rgba = color_radial_gradient(color, baseUV, texture_scale, main_tex_size);
|
||||
}
|
||||
#endif
|
||||
|
||||
// apply color grading if defined
|
||||
#if defined(COLOR_TONING)
|
||||
if (use_color_toning)
|
||||
{
|
||||
color.rgb = color_toning(color);
|
||||
}
|
||||
#endif
|
||||
|
||||
// apply color ramp if defined
|
||||
#if defined(COLOR_RAMP)
|
||||
if (use_color_ramp)
|
||||
{
|
||||
color = color_ramp(color);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(COLOR_CHANGE)
|
||||
if (use_color_change)
|
||||
{
|
||||
color.rgb = color_change(color.rgb);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(COLOR_GHOST)
|
||||
if (use_color_ghost)
|
||||
{
|
||||
color = color_ghost(color);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(COLOR_HOLOGRAM)
|
||||
if (use_color_hologram)
|
||||
{
|
||||
color = color_hologram(color, baseUV);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(COLOR_POSTERIZE)
|
||||
if (use_color_posterize)
|
||||
{
|
||||
color.rgb = color_posterize(color.rgb);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(COLOR_NEGATIVE)
|
||||
if (use_color_negative)
|
||||
{
|
||||
color.rgb = color_negative(color.rgb);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(COLOR_GLOW)
|
||||
if (use_color_glow)
|
||||
{
|
||||
color.rgb = color_glow(color, baseUV, 1.);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(COLOR_HSV_SHIFT)
|
||||
if (use_color_hsv_shift)
|
||||
{
|
||||
color.rgb = hsv_shift(color.rgb);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(COLOR_SHADOW)
|
||||
if (use_color_shadow)
|
||||
{
|
||||
color = shadow(color, TEXTURE, baseUV);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(COLOR_GREYSCALE)
|
||||
if (use_color_greyscale)
|
||||
{
|
||||
color.rgb = color_greyscale(color.rgb);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(COLOR_SHINE)
|
||||
if (use_color_shine)
|
||||
{
|
||||
color = color_shine(color, baseUV);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(ALPHA_MASK)
|
||||
if (use_alpha_mask)
|
||||
{
|
||||
color.a = alpha_mask(color.a, baseUV, true);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(ALPHA_REMAP)
|
||||
if (use_alpha_remap)
|
||||
{
|
||||
color.a = alpha_remap(color.a);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(ALPHA_CUTOFF)
|
||||
if (use_alpha_cutoff)
|
||||
{
|
||||
color.a = alpha_cutoff(color.a);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(ALPHA_CLIP)
|
||||
if (use_alpha_clip)
|
||||
{
|
||||
color.a = alpha_clip(color.a, baseUV, texture_scale);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(ALPHA_RADIAL_CLIP)
|
||||
if (use_alpha_radial_clip)
|
||||
{
|
||||
color.a = alpha_radial_clip(color.a, baseUV, texture_scale);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(ALPHA_FLICKER)
|
||||
if (use_alpha_flicker)
|
||||
{
|
||||
color.a = alpha_flicker(color.a);
|
||||
}
|
||||
#endif
|
||||
|
||||
color.a *= texture_alpha;
|
||||
|
||||
// if the following line throws an error thats a godot bug, ignore it.
|
||||
// Shader works as intented
|
||||
COLOR = color;
|
||||
}
|
||||
72
VFEZ/Shaders/vfez_3d_example.gdshader
Normal file
72
VFEZ/Shaders/vfez_3d_example.gdshader
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
// this code servers as an example VFEZ3D shader
|
||||
// that uses the VFEZ3D template. Files like this are
|
||||
// automatically generated using the VFEZMaterial but you
|
||||
// can also create them manually like the example below.
|
||||
|
||||
shader_type spatial;
|
||||
|
||||
#define BLEND_MIX
|
||||
//#define BLEND_ADD
|
||||
//#define BLEND_SUB
|
||||
//#define BLEND_MUL
|
||||
//#define BLEND_PREMUL_ALPHA
|
||||
|
||||
#define DEPTH_DRAW_OPAQUE
|
||||
//#define DEPTH_DRAW_ALWAYS
|
||||
//#define DEPTH_DRAW_NEVER
|
||||
|
||||
#define CULL_BACK
|
||||
//#define CULL_FRONT
|
||||
//#define CULL_DISABLED
|
||||
|
||||
#define DIFFUSE_LAMBERT
|
||||
//#define DIFFUSE_LABERT_WRAP
|
||||
//#define DIFFUSE_BURLEY
|
||||
//#define DIFFUSE_TOON
|
||||
|
||||
#define SPECULAR_SCHLICK_GGX
|
||||
//#define SPECULAR_TOON
|
||||
//#define SPECULAR_DISABLED
|
||||
|
||||
//#define UNSHADED
|
||||
|
||||
//#define BILLBOARD_ENABLED
|
||||
//#define BILLBOARD_Y
|
||||
//#define BILLBOARD_PARTICLE
|
||||
//#define BILLBOARD_KEEP_SCALE
|
||||
|
||||
//#define NO_DEPTH_TEST
|
||||
|
||||
//#define PARTICLE_TRAILS
|
||||
//#define PARTICLE_ANIM
|
||||
|
||||
// enable more shapes to blend more textures
|
||||
#define SHAPE2
|
||||
#define SHAPE3
|
||||
|
||||
#define UV_PIXELATE
|
||||
#define UV_TWIST
|
||||
#define UV_HANDRAWN
|
||||
#define UV_SHAKE
|
||||
#define UV_WAVE
|
||||
#define UV_ROUND_WAVE
|
||||
#define UV_GLOBAL_DISTORTION
|
||||
|
||||
#define ALPHA_DISOLVE
|
||||
|
||||
#define COLOR_FACE_TINT
|
||||
#define COLOR_TONING
|
||||
#define COLOR_RAMP
|
||||
#define COLOR_POSTERIZE
|
||||
#define COLOR_RIM
|
||||
#define COLOR_GLOW
|
||||
#define COLOR_HSV_SHIFT
|
||||
|
||||
#define ALPHA_MASK
|
||||
#define ALPHA_REMAP
|
||||
#define ALPHA_CUTOFF
|
||||
|
||||
#define VERTEX_OFFSET
|
||||
#define VERTEX_EXPAND
|
||||
|
||||
#include "vfez_3d_template.gdshaderinc"
|
||||
913
VFEZ/Shaders/vfez_3d_template.gdshaderinc
Normal file
913
VFEZ/Shaders/vfez_3d_template.gdshaderinc
Normal file
|
|
@ -0,0 +1,913 @@
|
|||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// THE CODE BELOW IS NOT INTENDED TO BE CHANGED MANUALLY.
|
||||
// MANUAL CHANGES MIGHT CAUSE THE VFEZ MATERIAL TO WORK INCORRECTLY.
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
// shader code starts here -----------------------------------------------
|
||||
|
||||
#ifndef VFEZ_UTILS
|
||||
#include "Effects/vfez_utils.gdshaderinc"
|
||||
#define VFEZ_UTILS
|
||||
#endif
|
||||
|
||||
#if defined(UNSHADED)
|
||||
render_mode unshaded;
|
||||
#endif
|
||||
|
||||
#if defined(BLEND_MIX)
|
||||
render_mode blend_mix;
|
||||
#elif defined(BLEND_ADD)
|
||||
render_mode blend_add;
|
||||
#elif defined(BLEND_SUB)
|
||||
render_mode blend_sub;
|
||||
#elif defined(BLEND_MUL)
|
||||
render_mode blend_mul;
|
||||
#elif defined(BLEND_PREMUL_ALPHA)
|
||||
render_mode blend_premul_alpha;
|
||||
#endif
|
||||
|
||||
#if defined(DEPTH_DRAW_OPAQUE)
|
||||
render_mode depth_draw_opaque;
|
||||
#elif defined(DEPTH_DRAW_ALWAYS)
|
||||
render_mode depth_draw_always;
|
||||
#elif defined(DEPTH_DRAW_NEVER)
|
||||
render_mode depth_draw_never;
|
||||
#endif
|
||||
|
||||
#if defined(CULL_BACK)
|
||||
render_mode cull_back;
|
||||
#elif defined(CULL_FRONT)
|
||||
render_mode cull_front;
|
||||
#elif defined (CULL_DISABLED)
|
||||
render_mode cull_disabled;
|
||||
#endif
|
||||
|
||||
#if defined(DIFFUSE_LAMBERT)
|
||||
render_mode diffuse_lambert;
|
||||
#elif defined(DIFFUSE_LAMBERT_WRAP)
|
||||
render_mode diffuse_lambert_wrap;
|
||||
#elif defined(DIFFUSE_BURLEY)
|
||||
render_mode diffuse_burley;
|
||||
#elif defined(DIFFUSE_TOON)
|
||||
render_mode diffuse_toon;
|
||||
#endif
|
||||
|
||||
#if defined(SPECULAR_SCHLICK_GGX)
|
||||
render_mode specular_schlick_ggx;
|
||||
#elif defined(SPECULAR_TOON)
|
||||
render_mode specular_toon;
|
||||
#elif defined(SPECULAR_DISABLED)
|
||||
render_mode specular_disabled;
|
||||
#endif
|
||||
|
||||
#if defined(NO_DEPTH_TEST)
|
||||
render_mode depth_test_disabled;
|
||||
#endif
|
||||
|
||||
#if defined(PARTICLE_TRAILS)
|
||||
render_mode particle_trails;
|
||||
#endif
|
||||
|
||||
group_uniforms general;
|
||||
uniform vec3 global_color: source_color = vec3(1.);
|
||||
uniform float global_alpha: hint_range(0.0, 1.0) = 1.;
|
||||
uniform bool additive_config = false;
|
||||
uniform bool premultiply_color = false;
|
||||
uniform bool premultiply_alpha = false;
|
||||
group_uniforms;
|
||||
|
||||
group_uniforms shape1.shape_texture;
|
||||
uniform sampler2D shape1_main_texture: source_color, filter_nearest;
|
||||
uniform vec2 shape1_main_texture_scale = vec2(1.);
|
||||
uniform vec2 shape1_main_texture_offset = vec2(0.);
|
||||
uniform vec4 shape1_color: source_color = vec4(1.);
|
||||
uniform bool shape1_red_as_alpha = false;
|
||||
uniform vec2 shape1_scroll_speed = vec2(0.);
|
||||
uniform float shape1_rotation_offset: hint_range(0.0, 6.28318530718) = 0.;
|
||||
uniform float shape1_rotation_speed = 0.;
|
||||
group_uniforms;
|
||||
|
||||
group_uniforms shape1.contrast_brightness;
|
||||
uniform float shape1_contrast: hint_range(0.0, 10) = 1.;
|
||||
uniform float shape1_brightness: hint_range(-1., 1.) = 0.;
|
||||
group_uniforms;
|
||||
|
||||
group_uniforms shape1.distortion;
|
||||
uniform sampler2D shape1_distortion_texture: source_color;
|
||||
uniform vec2 shape1_distortion_texture_scale = vec2(1.);
|
||||
uniform vec2 shape1_distortion_texture_offset = vec2(0.);
|
||||
uniform float shape1_distortion_amount: hint_range(0.0, 10) = 0.0;
|
||||
uniform vec2 shape1_distortion_speed = vec2(0.1);
|
||||
group_uniforms;
|
||||
|
||||
group_uniforms shape1.polar_uv;
|
||||
uniform bool shape1_use_polar_uv = false;
|
||||
uniform vec2 shape1_polar_uv_center = vec2(0.5);
|
||||
uniform bool shape1_distortion_polar_uvs = false;
|
||||
group_uniforms;
|
||||
|
||||
group_uniforms shape1.screenspace_uv;
|
||||
uniform bool shape1_use_screenspace_uv;
|
||||
group_uniforms;
|
||||
|
||||
group_uniforms shape2;
|
||||
uniform bool use_shape2 = false;
|
||||
group_uniforms;
|
||||
|
||||
#if defined(SHAPE2)
|
||||
group_uniforms shape2.shape_texture;
|
||||
uniform sampler2D shape2_main_texture: source_color, filter_nearest;
|
||||
uniform vec2 shape2_main_texture_scale = vec2(1.);
|
||||
uniform vec2 shape2_main_texture_offset = vec2(0.);
|
||||
uniform vec4 shape2_color: source_color = vec4(1.);
|
||||
uniform bool shape2_red_as_alpha = false;
|
||||
uniform vec2 shape2_scroll_speed = vec2(0.);
|
||||
uniform float shape2_rotation_offset: hint_range(0.0, 6.28318530718) = 0.;
|
||||
uniform float shape2_rotation_speed = 0.;
|
||||
group_uniforms;
|
||||
|
||||
group_uniforms shape2.contrast_brightness;
|
||||
uniform float shape2_contrast: hint_range(0.0, 10) = 1.;
|
||||
uniform float shape2_brightness: hint_range(-1., 1.) = 0.;
|
||||
group_uniforms;
|
||||
|
||||
group_uniforms shape2.distortion;
|
||||
uniform sampler2D shape2_distortion_texture: source_color;
|
||||
uniform vec2 shape2_distortion_texture_scale = vec2(1.);
|
||||
uniform vec2 shape2_distortion_texture_offset = vec2(0.);
|
||||
uniform float shape2_distortion_amount: hint_range(0.0, 10) = 0.0;
|
||||
uniform vec2 shape2_distortion_speed = vec2(0.1);
|
||||
group_uniforms;
|
||||
|
||||
group_uniforms shape2.polar_uv;
|
||||
uniform bool shape2_use_polar_uv = false;
|
||||
uniform vec2 shape2_polar_uv_center = vec2(0.5);
|
||||
uniform bool shape2_distortion_polar_uvs = false;
|
||||
group_uniforms;
|
||||
|
||||
group_uniforms shape2.screenspace_uv;
|
||||
uniform bool shape2_use_screenspace_uv;
|
||||
group_uniforms;
|
||||
#endif
|
||||
|
||||
group_uniforms shape3;
|
||||
uniform bool use_shape3 = false;
|
||||
group_uniforms;
|
||||
|
||||
#if defined(SHAPE3)
|
||||
group_uniforms shape3.shape_texture;
|
||||
uniform sampler2D shape3_main_texture: source_color, filter_nearest;
|
||||
uniform vec2 shape3_main_texture_scale = vec2(1.);
|
||||
uniform vec2 shape3_main_texture_offset = vec2(0.);
|
||||
uniform vec4 shape3_color: source_color = vec4(1.);
|
||||
uniform bool shape3_red_as_alpha = false;
|
||||
uniform vec2 shape3_scroll_speed = vec2(0.);
|
||||
uniform float shape3_rotation_offset: hint_range(0.0, 6.28318530718) = 0.;
|
||||
uniform float shape3_rotation_speed = 0.;
|
||||
group_uniforms;
|
||||
|
||||
group_uniforms shape3.contrast_brightness;
|
||||
uniform float shape3_contrast: hint_range(0.0, 10) = 1.;
|
||||
uniform float shape3_brightness: hint_range(-1., 1.) = 0.;
|
||||
group_uniforms;
|
||||
|
||||
group_uniforms shape3.distortion;
|
||||
uniform sampler2D shape3_distortion_texture: source_color;
|
||||
uniform vec2 shape3_distortion_texture_scale = vec2(1.);
|
||||
uniform vec2 shape3_distortion_texture_offset = vec2(0.);
|
||||
uniform float shape3_distortion_amount: hint_range(0.0, 10) = 0.0;
|
||||
uniform vec2 shape3_distortion_speed = vec2(0.1);
|
||||
group_uniforms;
|
||||
|
||||
group_uniforms shape3.polar_uv;
|
||||
uniform bool shape3_use_polar_uv = false;
|
||||
uniform vec2 shape3_polar_uv_center = vec2(0.5);
|
||||
uniform bool shape3_distortion_polar_uvs = false;
|
||||
group_uniforms;
|
||||
|
||||
group_uniforms shape3.screenspace_uv;
|
||||
uniform bool shape3_use_screenspace_uv;
|
||||
group_uniforms;
|
||||
#endif
|
||||
|
||||
group_uniforms combine_shapes;
|
||||
#if defined(SHAPE2) || defined(SHAPE3)
|
||||
uniform bool combine_additive = false;
|
||||
uniform float shape1_color_weight: hint_range(0.0, 5.) = 1;
|
||||
uniform float shape1_alpha_weight: hint_range(0.0, 5.) = 1;
|
||||
#endif
|
||||
#if defined(SHAPE2)
|
||||
uniform float shape2_color_weight: hint_range(0.0, 5.) = 1;
|
||||
uniform float shape2_alpha_weight: hint_range(0.0, 5.) = 1;
|
||||
#endif
|
||||
#if defined(SHAPE3)
|
||||
uniform float shape3_color_weight: hint_range(0.0, 5.) = 1;
|
||||
uniform float shape3_alpha_weight: hint_range(0.0, 5.) = 1;
|
||||
#endif
|
||||
group_uniforms;
|
||||
|
||||
group_uniforms uv_pixelate;
|
||||
uniform bool use_uv_pixelate = false;
|
||||
group_uniforms;
|
||||
#if defined(UV_PIXELATE)
|
||||
#include "Effects/vfez_uv_pixelate.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms uv_twist;
|
||||
uniform bool use_uv_twist = false;
|
||||
group_uniforms;
|
||||
#if defined(UV_TWIST)
|
||||
#include "Effects/vfez_uv_twist.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms uv_handrawn;
|
||||
uniform bool use_uv_handrawn = false;
|
||||
group_uniforms;
|
||||
#if defined(UV_HANDRAWN)
|
||||
#include "Effects/vfez_uv_handrawn.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms uv_shake;
|
||||
uniform bool use_uv_shake = false;
|
||||
group_uniforms;
|
||||
#if defined(UV_SHAKE)
|
||||
#include "Effects/vfez_uv_shake.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms uv_wave;
|
||||
uniform bool use_uv_wave = false;
|
||||
group_uniforms;
|
||||
#if defined(UV_WAVE)
|
||||
#include "Effects/vfez_uv_wave.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms uv_round_wave;
|
||||
uniform bool use_uv_round_wave = false;
|
||||
group_uniforms;
|
||||
#if defined(UV_ROUND_WAVE)
|
||||
#include "Effects/vfez_uv_round_wave.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms uv_global_distortion;
|
||||
uniform bool use_uv_global_distortion = false;
|
||||
#if defined(UV_GLOBAL_DISTORTION)
|
||||
uniform vec2 uv_global_distortion_texture_scale = vec2(1.);
|
||||
uniform vec2 uv_global_distortion_texture_offset = vec2(0.);
|
||||
uniform sampler2D uv_global_distortion_texture: source_color;
|
||||
uniform vec2 uv_global_distortion_speed;
|
||||
uniform float uv_global_distortion_amount: hint_range(0.0, 10.0) = 0.5;
|
||||
#endif
|
||||
group_uniforms;
|
||||
|
||||
group_uniforms alpha_disolve;
|
||||
uniform bool use_alpha_disolve = false;
|
||||
group_uniforms;
|
||||
#if defined(ALPHA_DISOLVE)
|
||||
#include "Effects/vfez_alpha_disolve.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms color_face_tint;
|
||||
uniform bool use_color_face_tint = false;
|
||||
group_uniforms;
|
||||
#if defined(COLOR_FACE_TINT)
|
||||
#include "Effects/vfez_color_face_tint.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms color_toning;
|
||||
uniform bool use_color_toning = false;
|
||||
group_uniforms;
|
||||
#if defined(COLOR_TONING)
|
||||
#include "Effects/vfez_color_toning.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms color_ramp;
|
||||
uniform bool use_color_ramp = false;
|
||||
group_uniforms;
|
||||
#if defined(COLOR_RAMP)
|
||||
#include "Effects/vfez_color_ramp.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms color_posterize;
|
||||
uniform bool use_color_posterize = false;
|
||||
group_uniforms;
|
||||
#if defined(COLOR_POSTERIZE)
|
||||
#include "Effects/vfez_color_posterize.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms color_rim;
|
||||
uniform bool use_color_rim = false;
|
||||
group_uniforms;
|
||||
#if defined(COLOR_RIM)
|
||||
#include "Effects/vfez_color_rim.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms color_glow;
|
||||
uniform bool use_color_glow = false;
|
||||
group_uniforms;
|
||||
#if defined(COLOR_GLOW)
|
||||
#include "Effects/vfez_color_glow.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms color_hsv_shift;
|
||||
uniform bool use_color_hsv_shift = false;
|
||||
group_uniforms;
|
||||
#if defined(COLOR_HSV_SHIFT)
|
||||
#include "Effects/vfez_hsv_shift.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms alpha_mask;
|
||||
uniform bool use_alpha_mask = false;
|
||||
group_uniforms;
|
||||
#if defined(ALPHA_MASK)
|
||||
#include "Effects/vfez_alpha_mask.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms alpha_remap;
|
||||
uniform bool use_alpha_remap = false;
|
||||
group_uniforms;
|
||||
#if defined(ALPHA_REMAP)
|
||||
#include "Effects/vfez_alpha_remap.gdshaderinc"
|
||||
#endif
|
||||
|
||||
group_uniforms alpha_cutoff;
|
||||
uniform bool use_alpha_cutoff = false;
|
||||
group_uniforms;
|
||||
#if defined(ALPHA_CUTOFF)
|
||||
#include "Effects/vfez_alpha_cutoff.gdshaderinc"
|
||||
#endif
|
||||
|
||||
|
||||
group_uniforms vertex_offset;
|
||||
uniform bool use_vertex_offset = false;
|
||||
group_uniforms;
|
||||
#if defined(VERTEX_OFFSET)
|
||||
#include "Effects/vfez_vertex_offset.gdshaderinc"
|
||||
#endif
|
||||
|
||||
|
||||
group_uniforms vertex_expand;
|
||||
uniform bool use_vertex_expand;
|
||||
group_uniforms;
|
||||
#if defined(VERTEX_EXPAND)
|
||||
#include "Effects/vfez_vertex_expand.gdshaderinc"
|
||||
#endif
|
||||
|
||||
|
||||
group_uniforms particle;
|
||||
uniform bool use_particle_trails = false;
|
||||
uniform bool use_particle_anim = false;
|
||||
group_uniforms;
|
||||
|
||||
#if defined(PARTICLE_ANIM)
|
||||
#include "Effects/vfez_particle_anim.gdshaderinc"
|
||||
#endif
|
||||
|
||||
|
||||
varying vec3 view_direction;
|
||||
varying vec3 world_normal;
|
||||
varying vec2 screenspace_uv;
|
||||
|
||||
// calculate single shape function ------------------------------
|
||||
|
||||
vec4 calculate_shape(
|
||||
vec2 baseUV,
|
||||
sampler2D shape_main_texture,
|
||||
vec2 shape_main_texture_scale,
|
||||
vec2 shape_main_texture_offset,
|
||||
sampler2D shape_distortion_texture,
|
||||
vec2 shape_distortion_texture_scale,
|
||||
vec2 shape_distortion_texture_offset,
|
||||
float shape_distortion_amount,
|
||||
vec2 shape_distortion_speed,
|
||||
float shape_rotation_speed,
|
||||
float shape_rotation_offset,
|
||||
vec2 shape_scroll_speed,
|
||||
bool shape_red_as_alpha,
|
||||
vec4 shape_color,
|
||||
float shape_contrast,
|
||||
float shape_brightness,
|
||||
bool shape_use_polar_uv,
|
||||
vec2 shape_polar_uv_center,
|
||||
bool shape_distortion_polar_uvs
|
||||
)
|
||||
{
|
||||
vec2 shapeUV = baseUV;
|
||||
|
||||
if (shape_use_polar_uv)
|
||||
{
|
||||
shapeUV = uv_polar(shapeUV, shape_polar_uv_center);
|
||||
}
|
||||
|
||||
shapeUV = transform_uv(
|
||||
shapeUV,
|
||||
shape_main_texture_scale,
|
||||
shape_main_texture_offset,
|
||||
false);
|
||||
|
||||
|
||||
if (shape_distortion_amount > 0.)
|
||||
{
|
||||
vec2 distort_uvs = baseUV;
|
||||
|
||||
//distort_uvs
|
||||
vec2 distortionUV = baseUV;
|
||||
distortionUV = transform_uv(
|
||||
distortionUV,
|
||||
shape_distortion_texture_scale,
|
||||
shape_distortion_texture_offset,
|
||||
false);
|
||||
|
||||
if (shape_use_polar_uv && shape_distortion_polar_uvs)
|
||||
{
|
||||
distortionUV = uv_polar(distortionUV, shape_polar_uv_center);
|
||||
}
|
||||
|
||||
shapeUV = uv_distortion(shapeUV, shape_distortion_texture, distortionUV,
|
||||
shape_distortion_amount, shape_distortion_speed, false);
|
||||
}
|
||||
|
||||
shapeUV = rotate_uvs(
|
||||
shapeUV,
|
||||
shape_rotation_offset + mod(shape_rotation_speed * TIME, TAU),
|
||||
shape_main_texture_scale,
|
||||
shape_main_texture_offset);
|
||||
|
||||
|
||||
vec4 shape = sample_texture_with_scroll(
|
||||
shape_main_texture,
|
||||
shapeUV,
|
||||
shape_scroll_speed,
|
||||
TIME);
|
||||
|
||||
if (shape_red_as_alpha)
|
||||
{
|
||||
shape = vec4(shape_color.rgb, shape.r);
|
||||
}
|
||||
else
|
||||
{
|
||||
shape *= shape_color;
|
||||
}
|
||||
|
||||
bool apply_contrast = shape_contrast != 1. || shape_brightness != 0.;
|
||||
|
||||
if (apply_contrast)
|
||||
{
|
||||
if (shape_red_as_alpha)
|
||||
{
|
||||
shape.a = clamp(
|
||||
(shape.a - 0.5) * shape_contrast + 0.5 + shape_brightness,
|
||||
0.,
|
||||
1.);
|
||||
}
|
||||
else
|
||||
{
|
||||
shape.rgb = vec3(
|
||||
max(0, (shape.r - 0.5) * shape_contrast + 0.5 + shape_brightness),
|
||||
max(0, (shape.g - 0.5) * shape_contrast + 0.5 + shape_brightness),
|
||||
max(0, (shape.b - 0.5) * shape_contrast + 0.5 + shape_brightness)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return shape;
|
||||
}
|
||||
|
||||
bool is_using_screen_space_uv()
|
||||
{
|
||||
bool using_shape2_screenspace_uv = false;
|
||||
bool using_shape3_screenspace_uv = false;
|
||||
#if defined(SHAPE2)
|
||||
using_shape2_screenspace_uv = shape2_use_screenspace_uv;
|
||||
#endif
|
||||
|
||||
#if defined(SHAPE3)
|
||||
using_shape3_screenspace_uv = shape3_use_screenspace_uv;
|
||||
#endif
|
||||
|
||||
return shape1_use_screenspace_uv || using_shape2_screenspace_uv || using_shape3_screenspace_uv;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------
|
||||
|
||||
void vertex() {
|
||||
|
||||
#if defined(BILLBOARD_ENABLED)
|
||||
MODELVIEW_MATRIX = VIEW_MATRIX * mat4(
|
||||
MAIN_CAM_INV_VIEW_MATRIX[0],
|
||||
MAIN_CAM_INV_VIEW_MATRIX[1],
|
||||
MAIN_CAM_INV_VIEW_MATRIX[2],
|
||||
MODEL_MATRIX[3]);
|
||||
#elif defined(BILLBOARD_Y)
|
||||
MODELVIEW_MATRIX = VIEW_MATRIX * mat4(
|
||||
vec4(normalize(cross(vec3(0.0, 1.0, 0.0), MAIN_CAM_INV_VIEW_MATRIX[2].xyz)), 0.0),
|
||||
vec4(0.0, 1.0, 0.0, 0.0),
|
||||
vec4(normalize(cross(MAIN_CAM_INV_VIEW_MATRIX[0].xyz, vec3(0.0, 1.0, 0.0))), 0.0),
|
||||
MODEL_MATRIX[3]);
|
||||
#elif defined(BILLBOARD_PARTICLE)
|
||||
mat4 mat_world = mat4(
|
||||
normalize(INV_VIEW_MATRIX[0]),
|
||||
normalize(INV_VIEW_MATRIX[1]),
|
||||
normalize(INV_VIEW_MATRIX[2]),
|
||||
MODEL_MATRIX[3]);
|
||||
mat_world = mat_world * mat4(
|
||||
vec4(cos(INSTANCE_CUSTOM.x), -sin(INSTANCE_CUSTOM.x), 0.0, 0.0),
|
||||
vec4(sin(INSTANCE_CUSTOM.x), cos(INSTANCE_CUSTOM.x), 0.0, 0.0),
|
||||
vec4(0.0, 0.0, 1.0, 0.0),
|
||||
vec4(0.0, 0.0, 0.0, 1.0));
|
||||
MODELVIEW_MATRIX = VIEW_MATRIX * mat_world;
|
||||
#endif
|
||||
|
||||
#if (defined(BILLBOARD_ENABLED) || defined(BILLBOARD_Y) || defined(BILLBOARD_PARTICLE)) && defined(BILLBOARD_KEEP_SCALE)
|
||||
MODELVIEW_MATRIX = MODELVIEW_MATRIX * mat4(
|
||||
vec4(length(MODEL_MATRIX[0].xyz), 0.0, 0.0, 0.0),
|
||||
vec4(0.0, length(MODEL_MATRIX[1].xyz), 0.0, 0.0),
|
||||
vec4(0.0, 0.0, length(MODEL_MATRIX[2].xyz), 0.0),
|
||||
vec4(0.0, 0.0, 0.0, 1.0));
|
||||
MODELVIEW_NORMAL_MATRIX = mat3(MODELVIEW_MATRIX);
|
||||
#endif
|
||||
|
||||
view_direction = normalize((
|
||||
INV_VIEW_MATRIX[3] - MODEL_MATRIX * vec4(VERTEX, 1.0)).rgb);
|
||||
|
||||
world_normal = normalize((MODEL_MATRIX * vec4(NORMAL, 1.0)).rgb);
|
||||
|
||||
#if defined(VERTEX_OFFSET)
|
||||
if (use_vertex_offset)
|
||||
{
|
||||
VERTEX = vertex_offset(VERTEX, NORMAL, UV);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(VERTEX_EXPAND)
|
||||
if (use_vertex_expand)
|
||||
{
|
||||
VERTEX = vertex_expand(VERTEX);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(PARTICLE_ANIM)
|
||||
if (use_particle_anim)
|
||||
{
|
||||
UV = particle_anim(INSTANCE_CUSTOM.z, UV);
|
||||
}
|
||||
#endif
|
||||
|
||||
bool using_screen_space_uv = is_using_screen_space_uv();
|
||||
|
||||
// only calculate screenspace uv if used at least by 1 shape
|
||||
if (using_screen_space_uv)
|
||||
{
|
||||
vec4 position_v = MODELVIEW_MATRIX * vec4(VERTEX, 1.0);
|
||||
vec4 position_cs = PROJECTION_MATRIX * vec4(position_v.xyz, 1.0);
|
||||
vec2 ndc = position_cs.xy / position_cs.w;
|
||||
screenspace_uv = ndc.xy * 0.5 + 0.5;
|
||||
}
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
|
||||
// clamp UVS near edges (0., 1., 2., 3., 4., 5.) to reduce folding artifacts
|
||||
vec2 uv_floor_top_included = max(vec2(0.), ceil(UV) - vec2(1.));
|
||||
vec2 clampedUV = clamp(UV, vec2(0.001) + uv_floor_top_included, vec2(0.999) + uv_floor_top_included);
|
||||
vec2 baseUV = clampedUV;
|
||||
|
||||
#if defined(UV_PIXELATE)
|
||||
if (use_uv_pixelate)
|
||||
{
|
||||
baseUV = uv_pixelate(baseUV, VIEWPORT_SIZE);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(UV_TWIST)
|
||||
if (use_uv_twist)
|
||||
{
|
||||
baseUV = uv_twist(baseUV, shape1_main_texture_scale);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(UV_HANDRAWN)
|
||||
if (use_uv_handrawn)
|
||||
{
|
||||
baseUV = uv_handrawn(baseUV);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(UV_SHAKE)
|
||||
if (use_uv_shake)
|
||||
{
|
||||
baseUV = uv_shake(baseUV);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(UV_WAVE)
|
||||
if (use_uv_wave)
|
||||
{
|
||||
baseUV = uv_wave(baseUV, VIEWPORT_SIZE, shape1_main_texture_scale);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(UV_ROUND_WAVE)
|
||||
if (use_uv_round_wave)
|
||||
{
|
||||
vec2 main_tex_size = vec2(textureSize(shape1_main_texture, 0));
|
||||
baseUV = uv_round_wave(baseUV, main_tex_size, shape1_main_texture_scale);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(UV_GLOBAL_DISTORTION)
|
||||
if (use_uv_global_distortion)
|
||||
{
|
||||
vec2 global_distortion_uv =
|
||||
transform_uv(baseUV,
|
||||
uv_global_distortion_texture_scale,
|
||||
uv_global_distortion_texture_offset,
|
||||
false);
|
||||
baseUV = uv_distortion(baseUV, uv_global_distortion_texture, global_distortion_uv,
|
||||
uv_global_distortion_amount, uv_global_distortion_speed, false);
|
||||
}
|
||||
#endif
|
||||
|
||||
vec2 shape1UV;
|
||||
|
||||
if (shape1_use_screenspace_uv)
|
||||
{
|
||||
shape1UV = screenspace_uv;
|
||||
}
|
||||
else
|
||||
{
|
||||
shape1UV = baseUV;
|
||||
}
|
||||
|
||||
// calculate shape 1
|
||||
vec4 shape1 = calculate_shape(
|
||||
shape1UV,
|
||||
shape1_main_texture,
|
||||
shape1_main_texture_scale,
|
||||
shape1_main_texture_offset,
|
||||
shape1_distortion_texture,
|
||||
shape1_distortion_texture_scale,
|
||||
shape1_distortion_texture_offset,
|
||||
shape1_distortion_amount,
|
||||
shape1_distortion_speed,
|
||||
shape1_rotation_speed,
|
||||
shape1_rotation_offset,
|
||||
shape1_scroll_speed,
|
||||
shape1_red_as_alpha,
|
||||
shape1_color,
|
||||
shape1_contrast,
|
||||
shape1_brightness,
|
||||
shape1_use_polar_uv,
|
||||
shape1_polar_uv_center,
|
||||
shape1_distortion_polar_uvs
|
||||
);
|
||||
|
||||
// calculate shape2 if defined
|
||||
#if defined(SHAPE2)
|
||||
|
||||
vec2 shape2UV;
|
||||
|
||||
if (shape2_use_screenspace_uv)
|
||||
{
|
||||
shape2UV = screenspace_uv;
|
||||
}
|
||||
else
|
||||
{
|
||||
shape2UV = baseUV;
|
||||
}
|
||||
|
||||
vec4 shape2 = calculate_shape(
|
||||
shape2UV,
|
||||
shape2_main_texture,
|
||||
shape2_main_texture_scale,
|
||||
shape2_main_texture_offset,
|
||||
shape2_distortion_texture,
|
||||
shape2_distortion_texture_scale,
|
||||
shape2_distortion_texture_offset,
|
||||
shape2_distortion_amount,
|
||||
shape2_distortion_speed,
|
||||
shape2_rotation_speed,
|
||||
shape2_rotation_offset,
|
||||
shape2_scroll_speed,
|
||||
shape2_red_as_alpha,
|
||||
shape2_color,
|
||||
shape2_contrast,
|
||||
shape2_brightness,
|
||||
shape2_use_polar_uv,
|
||||
shape2_polar_uv_center,
|
||||
shape2_distortion_polar_uvs
|
||||
);
|
||||
#endif
|
||||
|
||||
// calculate shape3 if defined
|
||||
#if defined(SHAPE3)
|
||||
|
||||
vec2 shape3UV;
|
||||
|
||||
if (shape3_use_screenspace_uv)
|
||||
{
|
||||
shape3UV = screenspace_uv;
|
||||
}
|
||||
else
|
||||
{
|
||||
shape3UV = baseUV;
|
||||
}
|
||||
|
||||
vec4 shape3 = calculate_shape(
|
||||
shape3UV,
|
||||
shape3_main_texture,
|
||||
shape3_main_texture_scale,
|
||||
shape3_main_texture_offset,
|
||||
shape3_distortion_texture,
|
||||
shape3_distortion_texture_scale,
|
||||
shape3_distortion_texture_offset,
|
||||
shape3_distortion_amount,
|
||||
shape3_distortion_speed,
|
||||
shape3_rotation_speed,
|
||||
shape3_rotation_offset,
|
||||
shape3_scroll_speed,
|
||||
shape3_red_as_alpha,
|
||||
shape3_color,
|
||||
shape3_contrast,
|
||||
shape3_brightness,
|
||||
shape3_use_polar_uv,
|
||||
shape3_polar_uv_center,
|
||||
shape3_distortion_polar_uvs
|
||||
);
|
||||
#endif
|
||||
|
||||
// ---combine shapes if more than one defined.---
|
||||
vec4 color = shape1;
|
||||
|
||||
#if defined(SHAPE2) || defined(SHAPE3)
|
||||
if (combine_additive)
|
||||
{
|
||||
color.rgb = shape1.rgb * shape1_color_weight * shape1.a;
|
||||
color.a = shape1.a * shape1_alpha_weight;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (shape1_color_weight > 0.)
|
||||
color.rgb = shape1.rgb * shape1_color_weight;
|
||||
else
|
||||
color.rgb = vec3(1.);
|
||||
|
||||
if (shape1_alpha_weight > 0.)
|
||||
color.a = shape1.a * shape1_alpha_weight;
|
||||
else
|
||||
color.a = 1.;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(SHAPE2)
|
||||
if (combine_additive)
|
||||
{
|
||||
color.rgb += shape2.rgb * shape2_color_weight * shape2.a;
|
||||
color.a = max(color.a, shape2.a * shape2_alpha_weight);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (shape2_color_weight > 0.)
|
||||
color.rgb *= shape2.rgb * shape2_color_weight;
|
||||
|
||||
if (shape2_alpha_weight > 0.)
|
||||
color.a *= shape2.a * shape2_alpha_weight;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(SHAPE3)
|
||||
if (combine_additive)
|
||||
{
|
||||
color.rgb += shape3.rgb * shape3_color_weight * shape3.a;
|
||||
color.a = max(color.a, shape3.a * shape3_alpha_weight);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (shape3_color_weight > 0.)
|
||||
color.rgb *= shape3.rgb * shape3_color_weight;
|
||||
|
||||
if (shape3_alpha_weight > 0.)
|
||||
color.a *= shape3.a * shape3_alpha_weight;
|
||||
}
|
||||
#endif
|
||||
|
||||
color.a = clamp(color.a, 0., 1.);
|
||||
|
||||
// ----------------------------------------------
|
||||
// apply premultiply color
|
||||
if (premultiply_color)
|
||||
{
|
||||
float luminance = get_color_luminance(color);
|
||||
color.a = min(luminance, color.a);
|
||||
}
|
||||
|
||||
color.rgb *= global_color * COLOR.rgb;
|
||||
|
||||
/// apply premultiply alpha
|
||||
if (premultiply_alpha)
|
||||
{
|
||||
color.rgb *= color.a;
|
||||
}
|
||||
|
||||
#if defined(ALPHA_DISOLVE)
|
||||
if (use_alpha_disolve)
|
||||
{
|
||||
float luminance = get_color_luminance(color);
|
||||
float pre_disolve_alpha = color.a;
|
||||
if (additive_config && !premultiply_color)
|
||||
{
|
||||
pre_disolve_alpha *= luminance;
|
||||
}
|
||||
|
||||
color = alpha_disolve(color, pre_disolve_alpha, COLOR.a, baseUV, false);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(COLOR_FACE_TINT)
|
||||
if (use_color_face_tint)
|
||||
{
|
||||
color.rgb = color_face_tint(color.rgb, world_normal, view_direction);
|
||||
}
|
||||
#endif
|
||||
|
||||
// apply color grading if defined
|
||||
#if defined(COLOR_TONING)
|
||||
if (use_color_toning)
|
||||
{
|
||||
color.rgb = color_toning(color);
|
||||
}
|
||||
#endif
|
||||
|
||||
// apply color ramp if defined
|
||||
#if defined(COLOR_RAMP)
|
||||
if (use_color_ramp)
|
||||
{
|
||||
color = color_ramp(color);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(COLOR_POSTERIZE)
|
||||
if (use_color_posterize)
|
||||
{
|
||||
color.rgb = color_posterize(color.rgb);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(COLOR_RIM)
|
||||
if (use_color_rim)
|
||||
{
|
||||
color = color_rim(color, NORMAL, VIEW);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(COLOR_GLOW)
|
||||
if (use_color_glow)
|
||||
{
|
||||
float glow_mult = 1.;
|
||||
if (additive_config)
|
||||
{
|
||||
float luminance = get_color_luminance(color);
|
||||
glow_mult = luminance;
|
||||
}
|
||||
|
||||
color.rgb = color_glow(color, baseUV, glow_mult);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(COLOR_HSV_SHIFT)
|
||||
if (use_color_hsv_shift)
|
||||
{
|
||||
color.rgb = hsv_shift(color.rgb);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(ALPHA_MASK)
|
||||
if (use_alpha_mask)
|
||||
{
|
||||
color.a = alpha_mask(color.a, clampedUV, false);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(ALPHA_REMAP)
|
||||
if (use_alpha_remap)
|
||||
{
|
||||
color.a = alpha_remap(color.a);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(ALPHA_CUTOFF)
|
||||
if (use_alpha_cutoff)
|
||||
{
|
||||
color.a = alpha_cutoff(color.a);
|
||||
}
|
||||
#endif
|
||||
|
||||
color.a = color.a * global_alpha * COLOR.a;
|
||||
|
||||
if (additive_config)
|
||||
{{
|
||||
color.rgb *= color.a;
|
||||
}}
|
||||
|
||||
ALBEDO = color.rgb;
|
||||
ALPHA = color.a;
|
||||
}
|
||||
1481
VFEZ/vfez_examples_2d.tscn
Normal file
1481
VFEZ/vfez_examples_2d.tscn
Normal file
File diff suppressed because it is too large
Load diff
838
VFEZ/vfez_examples_3d.tscn
Normal file
838
VFEZ/vfez_examples_3d.tscn
Normal file
|
|
@ -0,0 +1,838 @@
|
|||
[gd_scene load_steps=52 format=3 uid="uid://cf0wi8xo4rxpa"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/VFEZ-godot/vfez_material_3d.gd" id="1_o2hx6"]
|
||||
|
||||
[sub_resource type="Shader" id="Shader_5l0pc"]
|
||||
resource_name = "VFEZ3DPreview"
|
||||
code = "
|
||||
// This shader was dynamically generated by the VFEZ material.
|
||||
// **********************************
|
||||
// Every change to the VFEZ material Render Options or
|
||||
// Include Options generates a new shader. After every change
|
||||
// you can click on the new exported shader in the editor to view
|
||||
// the latest changes. Only the definitions (#define) actually change.
|
||||
// **********************************
|
||||
shader_type spatial;
|
||||
#define BLEND_MIX
|
||||
#define DEPTH_DRAW_OPAQUE
|
||||
#define CULL_BACK
|
||||
#define DIFFUSE_LAMBERT
|
||||
#define SPECULAR_SCHLICK_GGX
|
||||
#define UNSHADED
|
||||
#define COLOR_RAMP
|
||||
#define COLOR_GLOW
|
||||
#include \"res://addons/VFEZ-godot/Shaders/vfez_3d_template.gdshaderinc\"
|
||||
"
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_dk0f8"]
|
||||
colors = PackedColorArray(0, 0.184314, 1, 1, 0.376471, 0.411765, 1, 1)
|
||||
|
||||
[sub_resource type="GradientTexture1D" id="GradientTexture1D_flr16"]
|
||||
gradient = SubResource("Gradient_dk0f8")
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_arsos"]
|
||||
offsets = PackedFloat32Array(0, 0.516, 1)
|
||||
colors = PackedColorArray(1, 1, 1, 1, 0.819608, 0.819608, 0.819608, 1, 0, 0, 0, 1)
|
||||
|
||||
[sub_resource type="GradientTexture2D" id="GradientTexture2D_fwp2g"]
|
||||
gradient = SubResource("Gradient_arsos")
|
||||
width = 256
|
||||
height = 256
|
||||
fill = 1
|
||||
fill_from = Vector2(0.5, 0.5)
|
||||
fill_to = Vector2(0.175214, 0.153846)
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_ncvk1"]
|
||||
render_priority = 0
|
||||
shader = SubResource("Shader_5l0pc")
|
||||
shader_parameter/global_color = Color(1, 1, 1, 1)
|
||||
shader_parameter/global_alpha = 0.3
|
||||
shader_parameter/additive_config = false
|
||||
shader_parameter/premultiply_color = true
|
||||
shader_parameter/premultiply_alpha = false
|
||||
shader_parameter/shape1_main_texture_scale = Vector2(1, 1)
|
||||
shader_parameter/shape1_main_texture_offset = Vector2(0, 0)
|
||||
shader_parameter/shape1_color = Color(1, 1, 1, 1)
|
||||
shader_parameter/shape1_red_as_alpha = false
|
||||
shader_parameter/shape1_scroll_speed = Vector2(0, 0)
|
||||
shader_parameter/shape1_rotation_offset = 0.0
|
||||
shader_parameter/shape1_rotation_speed = 0.0
|
||||
shader_parameter/shape1_main_texture = SubResource("GradientTexture2D_fwp2g")
|
||||
shader_parameter/shape1_contrast = 1.0
|
||||
shader_parameter/shape1_brightness = 0.0
|
||||
shader_parameter/shape1_distortion_texture_scale = Vector2(1, 1)
|
||||
shader_parameter/shape1_distortion_texture_offset = Vector2(0, 0)
|
||||
shader_parameter/shape1_distortion_amount = 0.0
|
||||
shader_parameter/shape1_distortion_speed = Vector2(0.1, 0.1)
|
||||
shader_parameter/shape1_use_polar_uv = false
|
||||
shader_parameter/shape1_polar_uv_center = Vector2(0.5, 0.5)
|
||||
shader_parameter/shape1_distortion_polar_uvs = false
|
||||
shader_parameter/shape1_use_screenspace_uv = false
|
||||
shader_parameter/use_shape2 = false
|
||||
shader_parameter/use_shape3 = false
|
||||
shader_parameter/use_uv_pixelate = false
|
||||
shader_parameter/use_uv_twist = false
|
||||
shader_parameter/use_uv_handrawn = false
|
||||
shader_parameter/use_uv_shake = false
|
||||
shader_parameter/use_uv_wave = false
|
||||
shader_parameter/use_uv_round_wave = false
|
||||
shader_parameter/use_uv_global_distortion = false
|
||||
shader_parameter/use_alpha_disolve = false
|
||||
shader_parameter/use_color_face_tint = false
|
||||
shader_parameter/use_color_toning = false
|
||||
shader_parameter/use_color_ramp = true
|
||||
shader_parameter/color_ramp_albedo = Color(1, 1, 1, 1)
|
||||
shader_parameter/color_ramp_luminosity = 0.0
|
||||
shader_parameter/color_ramp_blend = 1.0
|
||||
shader_parameter/color_ramp_texture = SubResource("GradientTexture1D_flr16")
|
||||
shader_parameter/use_color_posterize = false
|
||||
shader_parameter/use_color_rim = false
|
||||
shader_parameter/use_color_glow = true
|
||||
shader_parameter/glow_color = Color(0, 0.215686, 1, 1)
|
||||
shader_parameter/glow_intensity = 3.0
|
||||
shader_parameter/glow_intensity_global = 1.0
|
||||
shader_parameter/use_glow_texture = false
|
||||
shader_parameter/use_color_hsv_shift = false
|
||||
shader_parameter/use_alpha_mask = false
|
||||
shader_parameter/use_alpha_remap = false
|
||||
shader_parameter/use_alpha_cutoff = false
|
||||
shader_parameter/use_vertex_offset = false
|
||||
shader_parameter/use_vertex_expand = false
|
||||
shader_parameter/use_particle_trails = false
|
||||
shader_parameter/use_particle_anim = false
|
||||
script = ExtResource("1_o2hx6")
|
||||
BlendMode = 0
|
||||
DepthDrawMode = 0
|
||||
CullMode = 0
|
||||
DiffuseMode = 0
|
||||
SpecularMode = 0
|
||||
ShadingMode = 0
|
||||
BillboardMode = 0
|
||||
BillboardKeepScale = false
|
||||
NoDepthTest = false
|
||||
|
||||
[sub_resource type="QuadMesh" id="QuadMesh_eyir6"]
|
||||
|
||||
[sub_resource type="Shader" id="Shader_m3jsb"]
|
||||
resource_name = "VFEZ3DPreview"
|
||||
code = "
|
||||
// This shader was dynamically generated by the VFEZ material.
|
||||
// **********************************
|
||||
// Every change to the VFEZ material Render Options or
|
||||
// Include Options generates a new shader. After every change
|
||||
// you can click on the new exported shader in the editor to view
|
||||
// the latest changes. Only the definitions (#define) actually change.
|
||||
// **********************************
|
||||
shader_type spatial;
|
||||
#define BLEND_MIX
|
||||
#define DEPTH_DRAW_OPAQUE
|
||||
#define CULL_BACK
|
||||
#define DIFFUSE_LAMBERT
|
||||
#define SPECULAR_SCHLICK_GGX
|
||||
#define UNSHADED
|
||||
#define SHAPE2
|
||||
#define COLOR_RAMP
|
||||
#define COLOR_GLOW
|
||||
#include \"res://addons/VFEZ-godot/Shaders/vfez_3d_template.gdshaderinc\"
|
||||
"
|
||||
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_q2wou"]
|
||||
|
||||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_57tcq"]
|
||||
seamless = true
|
||||
noise = SubResource("FastNoiseLite_q2wou")
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_o3o64"]
|
||||
offsets = PackedFloat32Array(0.289, 0.504, 0.585, 0.762)
|
||||
colors = PackedColorArray(0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1)
|
||||
|
||||
[sub_resource type="GradientTexture2D" id="GradientTexture2D_mdo8x"]
|
||||
gradient = SubResource("Gradient_o3o64")
|
||||
width = 256
|
||||
height = 256
|
||||
fill_from = Vector2(0.0042735, 1)
|
||||
fill_to = Vector2(0, 0)
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_0wske"]
|
||||
render_priority = 0
|
||||
shader = SubResource("Shader_m3jsb")
|
||||
shader_parameter/global_color = Color(1, 1, 1, 1)
|
||||
shader_parameter/global_alpha = 1.0
|
||||
shader_parameter/additive_config = false
|
||||
shader_parameter/premultiply_color = true
|
||||
shader_parameter/premultiply_alpha = false
|
||||
shader_parameter/shape1_main_texture_scale = Vector2(1, 4)
|
||||
shader_parameter/shape1_main_texture_offset = Vector2(0, 0)
|
||||
shader_parameter/shape1_color = Color(1, 1, 1, 1)
|
||||
shader_parameter/shape1_red_as_alpha = false
|
||||
shader_parameter/shape1_scroll_speed = Vector2(0, -0.5)
|
||||
shader_parameter/shape1_rotation_offset = 0.0
|
||||
shader_parameter/shape1_rotation_speed = 0.0
|
||||
shader_parameter/shape1_main_texture = SubResource("GradientTexture2D_mdo8x")
|
||||
shader_parameter/shape1_contrast = 1.0
|
||||
shader_parameter/shape1_brightness = 0.0
|
||||
shader_parameter/shape1_distortion_texture_scale = Vector2(1, 1)
|
||||
shader_parameter/shape1_distortion_texture_offset = Vector2(0, 0)
|
||||
shader_parameter/shape1_distortion_amount = 1.5
|
||||
shader_parameter/shape1_distortion_speed = Vector2(0.1, 0.1)
|
||||
shader_parameter/shape1_distortion_texture = SubResource("NoiseTexture2D_57tcq")
|
||||
shader_parameter/shape1_use_polar_uv = true
|
||||
shader_parameter/shape1_polar_uv_center = Vector2(0.5, 0.5)
|
||||
shader_parameter/shape1_distortion_polar_uvs = false
|
||||
shader_parameter/shape1_use_screenspace_uv = false
|
||||
shader_parameter/use_shape2 = true
|
||||
shader_parameter/shape2_main_texture_scale = Vector2(1, 1)
|
||||
shader_parameter/shape2_main_texture_offset = Vector2(0, 0)
|
||||
shader_parameter/shape2_color = Color(1, 1, 1, 1)
|
||||
shader_parameter/shape2_red_as_alpha = false
|
||||
shader_parameter/shape2_scroll_speed = Vector2(0, 0)
|
||||
shader_parameter/shape2_rotation_offset = 0.0
|
||||
shader_parameter/shape2_rotation_speed = 0.0
|
||||
shader_parameter/shape2_main_texture = SubResource("GradientTexture2D_fwp2g")
|
||||
shader_parameter/shape2_contrast = 1.0
|
||||
shader_parameter/shape2_brightness = 0.0
|
||||
shader_parameter/shape2_distortion_texture_scale = Vector2(1, 1)
|
||||
shader_parameter/shape2_distortion_texture_offset = Vector2(0, 0)
|
||||
shader_parameter/shape2_distortion_amount = 0.0
|
||||
shader_parameter/shape2_distortion_speed = Vector2(0.1, 0.1)
|
||||
shader_parameter/shape2_use_polar_uv = false
|
||||
shader_parameter/shape2_polar_uv_center = Vector2(0.5, 0.5)
|
||||
shader_parameter/shape2_distortion_polar_uvs = false
|
||||
shader_parameter/shape2_use_screenspace_uv = false
|
||||
shader_parameter/use_shape3 = false
|
||||
shader_parameter/combine_additive = false
|
||||
shader_parameter/shape1_color_weight = 1.0
|
||||
shader_parameter/shape1_alpha_weight = 1.0
|
||||
shader_parameter/shape2_color_weight = 2.0
|
||||
shader_parameter/shape2_alpha_weight = 1.0
|
||||
shader_parameter/use_uv_pixelate = false
|
||||
shader_parameter/use_uv_twist = false
|
||||
shader_parameter/use_uv_handrawn = false
|
||||
shader_parameter/use_uv_shake = false
|
||||
shader_parameter/use_uv_wave = false
|
||||
shader_parameter/use_uv_round_wave = false
|
||||
shader_parameter/use_uv_global_distortion = false
|
||||
shader_parameter/use_alpha_disolve = false
|
||||
shader_parameter/use_color_face_tint = false
|
||||
shader_parameter/use_color_toning = false
|
||||
shader_parameter/use_color_ramp = true
|
||||
shader_parameter/color_ramp_albedo = Color(1, 1, 1, 1)
|
||||
shader_parameter/color_ramp_luminosity = 0.0
|
||||
shader_parameter/color_ramp_blend = 1.0
|
||||
shader_parameter/color_ramp_texture = SubResource("GradientTexture1D_flr16")
|
||||
shader_parameter/use_color_posterize = false
|
||||
shader_parameter/use_color_rim = false
|
||||
shader_parameter/use_color_glow = true
|
||||
shader_parameter/glow_color = Color(0, 0.509804, 1, 1)
|
||||
shader_parameter/glow_intensity = 3.0
|
||||
shader_parameter/glow_intensity_global = 1.0
|
||||
shader_parameter/use_glow_texture = false
|
||||
shader_parameter/use_color_hsv_shift = false
|
||||
shader_parameter/use_alpha_mask = false
|
||||
shader_parameter/use_alpha_remap = false
|
||||
shader_parameter/use_alpha_cutoff = false
|
||||
shader_parameter/use_vertex_offset = false
|
||||
shader_parameter/use_vertex_expand = false
|
||||
shader_parameter/use_particle_trails = false
|
||||
shader_parameter/use_particle_anim = false
|
||||
script = ExtResource("1_o2hx6")
|
||||
BlendMode = 0
|
||||
DepthDrawMode = 0
|
||||
CullMode = 0
|
||||
DiffuseMode = 0
|
||||
SpecularMode = 0
|
||||
ShadingMode = 0
|
||||
BillboardMode = 0
|
||||
BillboardKeepScale = false
|
||||
NoDepthTest = false
|
||||
|
||||
[sub_resource type="Shader" id="Shader_35bul"]
|
||||
resource_name = "VFEZ3DPreview"
|
||||
code = "
|
||||
// This shader was dynamically generated by the VFEZ material.
|
||||
// **********************************
|
||||
// Every change to the VFEZ material Render Options or
|
||||
// Include Options generates a new shader. After every change
|
||||
// you can click on the new exported shader in the editor to view
|
||||
// the latest changes. Only the definitions (#define) actually change.
|
||||
// **********************************
|
||||
shader_type spatial;
|
||||
#define BLEND_MIX
|
||||
#define DEPTH_DRAW_OPAQUE
|
||||
#define CULL_BACK
|
||||
#define DIFFUSE_LAMBERT
|
||||
#define SPECULAR_SCHLICK_GGX
|
||||
#define UNSHADED
|
||||
#define BILLBOARD_PARTICLE
|
||||
#define BILLBOARD_KEEP_SCALE
|
||||
#define COLOR_GLOW
|
||||
#include \"res://addons/VFEZ-godot/Shaders/vfez_3d_template.gdshaderinc\"
|
||||
"
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_fubi6"]
|
||||
offsets = PackedFloat32Array(0.586466, 1)
|
||||
colors = PackedColorArray(1, 1, 1, 1, 0, 0, 0, 1)
|
||||
|
||||
[sub_resource type="GradientTexture2D" id="GradientTexture2D_bx8q0"]
|
||||
gradient = SubResource("Gradient_fubi6")
|
||||
fill = 1
|
||||
fill_from = Vector2(0.487179, 0.465812)
|
||||
fill_to = Vector2(0.149573, 0.132479)
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_wlr8l"]
|
||||
render_priority = 0
|
||||
shader = SubResource("Shader_35bul")
|
||||
shader_parameter/global_color = Color(1, 1, 1, 1)
|
||||
shader_parameter/global_alpha = 1.0
|
||||
shader_parameter/additive_config = false
|
||||
shader_parameter/premultiply_color = true
|
||||
shader_parameter/premultiply_alpha = false
|
||||
shader_parameter/shape1_main_texture_scale = Vector2(1, 1)
|
||||
shader_parameter/shape1_main_texture_offset = Vector2(0, 0)
|
||||
shader_parameter/shape1_color = Color(0, 0.368627, 1, 1)
|
||||
shader_parameter/shape1_red_as_alpha = false
|
||||
shader_parameter/shape1_scroll_speed = Vector2(0, 0)
|
||||
shader_parameter/shape1_rotation_offset = 0.0
|
||||
shader_parameter/shape1_rotation_speed = 0.0
|
||||
shader_parameter/shape1_main_texture = SubResource("GradientTexture2D_bx8q0")
|
||||
shader_parameter/shape1_contrast = 1.0
|
||||
shader_parameter/shape1_brightness = 0.0
|
||||
shader_parameter/shape1_distortion_texture_scale = Vector2(1, 1)
|
||||
shader_parameter/shape1_distortion_texture_offset = Vector2(0, 0)
|
||||
shader_parameter/shape1_distortion_amount = 0.0
|
||||
shader_parameter/shape1_distortion_speed = Vector2(0.1, 0.1)
|
||||
shader_parameter/shape1_use_polar_uv = false
|
||||
shader_parameter/shape1_polar_uv_center = Vector2(0.5, 0.5)
|
||||
shader_parameter/shape1_distortion_polar_uvs = false
|
||||
shader_parameter/shape1_use_screenspace_uv = false
|
||||
shader_parameter/use_shape2 = false
|
||||
shader_parameter/use_shape3 = false
|
||||
shader_parameter/use_uv_pixelate = false
|
||||
shader_parameter/use_uv_twist = false
|
||||
shader_parameter/use_uv_handrawn = false
|
||||
shader_parameter/use_uv_shake = false
|
||||
shader_parameter/use_uv_wave = false
|
||||
shader_parameter/use_uv_round_wave = false
|
||||
shader_parameter/use_uv_global_distortion = false
|
||||
shader_parameter/use_alpha_disolve = false
|
||||
shader_parameter/use_color_face_tint = false
|
||||
shader_parameter/use_color_toning = false
|
||||
shader_parameter/use_color_ramp = false
|
||||
shader_parameter/use_color_posterize = false
|
||||
shader_parameter/use_color_rim = false
|
||||
shader_parameter/use_color_glow = true
|
||||
shader_parameter/glow_color = Color(0, 0.368627, 1, 1)
|
||||
shader_parameter/glow_intensity = 50.0
|
||||
shader_parameter/glow_intensity_global = 40.0
|
||||
shader_parameter/use_glow_texture = false
|
||||
shader_parameter/use_color_hsv_shift = false
|
||||
shader_parameter/use_alpha_mask = false
|
||||
shader_parameter/use_alpha_remap = false
|
||||
shader_parameter/use_alpha_cutoff = false
|
||||
shader_parameter/use_vertex_offset = false
|
||||
shader_parameter/use_vertex_expand = false
|
||||
shader_parameter/use_particle_trails = false
|
||||
shader_parameter/use_particle_anim = false
|
||||
script = ExtResource("1_o2hx6")
|
||||
BlendMode = 0
|
||||
DepthDrawMode = 0
|
||||
CullMode = 0
|
||||
DiffuseMode = 0
|
||||
SpecularMode = 0
|
||||
ShadingMode = 0
|
||||
BillboardMode = 3
|
||||
BillboardKeepScale = true
|
||||
NoDepthTest = false
|
||||
|
||||
[sub_resource type="Curve" id="Curve_vq4uv"]
|
||||
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
|
||||
point_count = 2
|
||||
|
||||
[sub_resource type="CurveTexture" id="CurveTexture_u4lhj"]
|
||||
curve = SubResource("Curve_vq4uv")
|
||||
|
||||
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_3e8fx"]
|
||||
emission_shape = 6
|
||||
emission_ring_axis = Vector3(0, 1, 0)
|
||||
emission_ring_height = 0.0
|
||||
emission_ring_radius = 0.3
|
||||
emission_ring_inner_radius = 0.0
|
||||
direction = Vector3(0, 1, 0)
|
||||
spread = 0.0
|
||||
initial_velocity_min = 0.1
|
||||
initial_velocity_max = 0.4
|
||||
gravity = Vector3(0, 0, 0)
|
||||
damping_min = 0.2
|
||||
damping_max = 0.2
|
||||
alpha_curve = SubResource("CurveTexture_u4lhj")
|
||||
|
||||
[sub_resource type="QuadMesh" id="QuadMesh_t6fyf"]
|
||||
size = Vector2(0.1, 0.1)
|
||||
|
||||
[sub_resource type="Shader" id="Shader_y88k5"]
|
||||
resource_name = "VFEZ3DPreview"
|
||||
code = "
|
||||
// This shader was dynamically generated by the VFEZ material.
|
||||
// **********************************
|
||||
// Every change to the VFEZ material Render Options or
|
||||
// Include Options generates a new shader. After every change
|
||||
// you can click on the new exported shader in the editor to view
|
||||
// the latest changes. Only the definitions (#define) actually change.
|
||||
// **********************************
|
||||
shader_type spatial;
|
||||
#define BLEND_MIX
|
||||
#define DEPTH_DRAW_OPAQUE
|
||||
#define CULL_BACK
|
||||
#define DIFFUSE_LAMBERT
|
||||
#define SPECULAR_SCHLICK_GGX
|
||||
#define UNSHADED
|
||||
#define ALPHA_DISOLVE
|
||||
#define COLOR_RIM
|
||||
#include \"res://addons/VFEZ-godot/Shaders/vfez_3d_template.gdshaderinc\"
|
||||
"
|
||||
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_ro2bx"]
|
||||
|
||||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_wdl7p"]
|
||||
seamless = true
|
||||
noise = SubResource("FastNoiseLite_ro2bx")
|
||||
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_8dd0h"]
|
||||
|
||||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_280j0"]
|
||||
seamless = true
|
||||
noise = SubResource("FastNoiseLite_8dd0h")
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_d2148"]
|
||||
render_priority = 0
|
||||
shader = SubResource("Shader_y88k5")
|
||||
shader_parameter/global_color = Color(1, 1, 1, 1)
|
||||
shader_parameter/global_alpha = 1.0
|
||||
shader_parameter/additive_config = false
|
||||
shader_parameter/premultiply_color = false
|
||||
shader_parameter/premultiply_alpha = false
|
||||
shader_parameter/shape1_main_texture_scale = Vector2(1, 1)
|
||||
shader_parameter/shape1_main_texture_offset = Vector2(0, 0)
|
||||
shader_parameter/shape1_color = Color(0.858824, 0.345098, 0, 1)
|
||||
shader_parameter/shape1_red_as_alpha = false
|
||||
shader_parameter/shape1_scroll_speed = Vector2(0, 0)
|
||||
shader_parameter/shape1_rotation_offset = 0.0
|
||||
shader_parameter/shape1_rotation_speed = 0.0
|
||||
shader_parameter/shape1_contrast = 1.0
|
||||
shader_parameter/shape1_brightness = 0.0
|
||||
shader_parameter/shape1_distortion_texture_scale = Vector2(1, 1)
|
||||
shader_parameter/shape1_distortion_texture_offset = Vector2(0, 0)
|
||||
shader_parameter/shape1_distortion_amount = 0.0
|
||||
shader_parameter/shape1_distortion_speed = Vector2(0.1, 0.1)
|
||||
shader_parameter/shape1_use_polar_uv = false
|
||||
shader_parameter/shape1_polar_uv_center = Vector2(0.5, 0.5)
|
||||
shader_parameter/shape1_distortion_polar_uvs = false
|
||||
shader_parameter/shape1_use_screenspace_uv = false
|
||||
shader_parameter/use_shape2 = false
|
||||
shader_parameter/use_shape3 = false
|
||||
shader_parameter/use_uv_pixelate = false
|
||||
shader_parameter/use_uv_twist = false
|
||||
shader_parameter/use_uv_handrawn = false
|
||||
shader_parameter/use_uv_shake = false
|
||||
shader_parameter/use_uv_wave = false
|
||||
shader_parameter/use_uv_round_wave = false
|
||||
shader_parameter/use_uv_global_distortion = false
|
||||
shader_parameter/use_alpha_disolve = true
|
||||
shader_parameter/alpha_disolve_texture_scale = Vector2(1, 1)
|
||||
shader_parameter/alpha_disolve_texture_offset = Vector2(0, 0)
|
||||
shader_parameter/alpha_disolve_amount = 0.054
|
||||
shader_parameter/alpha_disolve_transition = 0.075
|
||||
shader_parameter/alpha_disolve_power = 0.5
|
||||
shader_parameter/alpha_disolve_scroll_speed = Vector2(0.2, 0.2)
|
||||
shader_parameter/alpha_disolve_texture = SubResource("NoiseTexture2D_280j0")
|
||||
shader_parameter/use_alpha_disolve_burn = true
|
||||
shader_parameter/alpha_disolve_burn_color = Color(1, 1, 0, 1)
|
||||
shader_parameter/alpha_disolve_burn_width = 0.031
|
||||
shader_parameter/alpha_disolve_burn_glow = 17.373
|
||||
shader_parameter/alpha_disolve_burn_texture = SubResource("NoiseTexture2D_wdl7p")
|
||||
shader_parameter/use_color_face_tint = false
|
||||
shader_parameter/use_color_toning = false
|
||||
shader_parameter/use_color_ramp = false
|
||||
shader_parameter/use_color_posterize = false
|
||||
shader_parameter/use_color_rim = true
|
||||
shader_parameter/rim_color = Color(0.972667, 1, 0.59, 1)
|
||||
shader_parameter/rim_bias = 0.0
|
||||
shader_parameter/rim_scale = 1.0
|
||||
shader_parameter/rim_power = 1.187
|
||||
shader_parameter/rim_intensity = 1.0
|
||||
shader_parameter/rim_add_amount = 1.0
|
||||
shader_parameter/rim_erodes_alpha = 0.0
|
||||
shader_parameter/use_color_glow = false
|
||||
shader_parameter/use_color_hsv_shift = false
|
||||
shader_parameter/use_alpha_mask = false
|
||||
shader_parameter/use_alpha_remap = false
|
||||
shader_parameter/use_alpha_cutoff = false
|
||||
shader_parameter/use_vertex_offset = false
|
||||
shader_parameter/use_vertex_expand = false
|
||||
shader_parameter/use_particle_trails = false
|
||||
shader_parameter/use_particle_anim = false
|
||||
script = ExtResource("1_o2hx6")
|
||||
BlendMode = 0
|
||||
DepthDrawMode = 0
|
||||
CullMode = 0
|
||||
DiffuseMode = 0
|
||||
SpecularMode = 0
|
||||
ShadingMode = 0
|
||||
BillboardMode = 0
|
||||
BillboardKeepScale = false
|
||||
NoDepthTest = false
|
||||
|
||||
[sub_resource type="SphereMesh" id="SphereMesh_x6q4p"]
|
||||
radius = 0.45
|
||||
height = 0.9
|
||||
|
||||
[sub_resource type="Shader" id="Shader_puju3"]
|
||||
resource_name = "VFEZ3DPreview"
|
||||
code = "
|
||||
// This shader was dynamically generated by the VFEZ material.
|
||||
// **********************************
|
||||
// Every change to the VFEZ material Render Options or
|
||||
// Include Options generates a new shader. After every change
|
||||
// you can click on the new exported shader in the editor to view
|
||||
// the latest changes. Only the definitions (#define) actually change.
|
||||
// **********************************
|
||||
shader_type spatial;
|
||||
#define BLEND_MIX
|
||||
#define DEPTH_DRAW_OPAQUE
|
||||
#define CULL_BACK
|
||||
#define DIFFUSE_LAMBERT
|
||||
#define SPECULAR_SCHLICK_GGX
|
||||
#define UNSHADED
|
||||
#define COLOR_TONING
|
||||
#define COLOR_RIM
|
||||
#define VERTEX_OFFSET
|
||||
#include \"res://addons/VFEZ-godot/Shaders/vfez_3d_template.gdshaderinc\"
|
||||
"
|
||||
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_goiqf"]
|
||||
|
||||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_l4boc"]
|
||||
seamless = true
|
||||
noise = SubResource("FastNoiseLite_goiqf")
|
||||
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_fm7x5"]
|
||||
noise_type = 3
|
||||
|
||||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_gjelf"]
|
||||
seamless = true
|
||||
noise = SubResource("FastNoiseLite_fm7x5")
|
||||
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_7epju"]
|
||||
|
||||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_21bhv"]
|
||||
seamless = true
|
||||
noise = SubResource("FastNoiseLite_7epju")
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_b7o1b"]
|
||||
render_priority = 10
|
||||
shader = SubResource("Shader_puju3")
|
||||
shader_parameter/global_color = Color(1, 1, 1, 1)
|
||||
shader_parameter/global_alpha = 1.0
|
||||
shader_parameter/additive_config = false
|
||||
shader_parameter/premultiply_color = false
|
||||
shader_parameter/premultiply_alpha = false
|
||||
shader_parameter/shape1_main_texture_scale = Vector2(1, 1)
|
||||
shader_parameter/shape1_main_texture_offset = Vector2(0, 0)
|
||||
shader_parameter/shape1_color = Color(1, 1, 1, 1)
|
||||
shader_parameter/shape1_red_as_alpha = true
|
||||
shader_parameter/shape1_scroll_speed = Vector2(0.1, 0.1)
|
||||
shader_parameter/shape1_rotation_offset = 0.0
|
||||
shader_parameter/shape1_rotation_speed = 0.0
|
||||
shader_parameter/shape1_main_texture = SubResource("NoiseTexture2D_gjelf")
|
||||
shader_parameter/shape1_contrast = 2.18
|
||||
shader_parameter/shape1_brightness = -0.05
|
||||
shader_parameter/shape1_distortion_texture_scale = Vector2(1, 1)
|
||||
shader_parameter/shape1_distortion_texture_offset = Vector2(0, 0)
|
||||
shader_parameter/shape1_distortion_amount = 2.0
|
||||
shader_parameter/shape1_distortion_speed = Vector2(0.2, 0.2)
|
||||
shader_parameter/shape1_distortion_texture = SubResource("NoiseTexture2D_l4boc")
|
||||
shader_parameter/shape1_use_polar_uv = false
|
||||
shader_parameter/shape1_polar_uv_center = Vector2(0.5, 0.5)
|
||||
shader_parameter/shape1_distortion_polar_uvs = false
|
||||
shader_parameter/shape1_use_screenspace_uv = false
|
||||
shader_parameter/use_shape2 = false
|
||||
shader_parameter/use_shape3 = false
|
||||
shader_parameter/use_uv_pixelate = false
|
||||
shader_parameter/use_uv_twist = false
|
||||
shader_parameter/use_uv_handrawn = false
|
||||
shader_parameter/use_uv_shake = false
|
||||
shader_parameter/use_uv_wave = false
|
||||
shader_parameter/use_uv_round_wave = false
|
||||
shader_parameter/use_uv_global_distortion = false
|
||||
shader_parameter/use_alpha_disolve = false
|
||||
shader_parameter/use_color_face_tint = false
|
||||
shader_parameter/use_color_toning = true
|
||||
shader_parameter/color_grading_light_tone = Color(0.9, 1, 0, 1)
|
||||
shader_parameter/color_grading_mid_tone = Color(1, 0.55, 0, 1)
|
||||
shader_parameter/color_grading_dark_tone = Color(0.513726, 0, 0, 1)
|
||||
shader_parameter/color_grading_mid_point = 0.5
|
||||
shader_parameter/use_color_ramp = false
|
||||
shader_parameter/use_color_posterize = false
|
||||
shader_parameter/use_color_rim = true
|
||||
shader_parameter/rim_color = Color(0.972667, 1, 0.59, 1)
|
||||
shader_parameter/rim_bias = 0.0
|
||||
shader_parameter/rim_scale = 1.0
|
||||
shader_parameter/rim_power = 1.902
|
||||
shader_parameter/rim_intensity = 1.2
|
||||
shader_parameter/rim_add_amount = 1.0
|
||||
shader_parameter/rim_erodes_alpha = 0.0
|
||||
shader_parameter/use_color_glow = false
|
||||
shader_parameter/use_color_hsv_shift = false
|
||||
shader_parameter/use_alpha_mask = false
|
||||
shader_parameter/use_alpha_remap = false
|
||||
shader_parameter/use_alpha_cutoff = false
|
||||
shader_parameter/use_vertex_offset = true
|
||||
shader_parameter/vertex_offset_amount = 0.1
|
||||
shader_parameter/vertex_offset_power = 1.0
|
||||
shader_parameter/vertex_offset_speed = Vector2(0.1, 0.1)
|
||||
shader_parameter/vertex_offset_texture = SubResource("NoiseTexture2D_21bhv")
|
||||
shader_parameter/use_vertex_expand = false
|
||||
shader_parameter/use_particle_trails = false
|
||||
shader_parameter/use_particle_anim = false
|
||||
script = ExtResource("1_o2hx6")
|
||||
BlendMode = 0
|
||||
DepthDrawMode = 0
|
||||
CullMode = 0
|
||||
DiffuseMode = 0
|
||||
SpecularMode = 0
|
||||
ShadingMode = 0
|
||||
BillboardMode = 0
|
||||
BillboardKeepScale = false
|
||||
NoDepthTest = false
|
||||
|
||||
[sub_resource type="SphereMesh" id="SphereMesh_4wcxn"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_bymho"]
|
||||
resource_name = "Idle"
|
||||
length = 4.0
|
||||
loop_mode = 1
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("SphereIn:material_override:shader_parameter/alpha_disolve_amount")
|
||||
tracks/0/interp = 2
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 2, 3.9),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [0.5, 0.8, 0.5]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_c2ts8"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("SphereIn:material_override:shader_parameter/alpha_disolve_amount")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [0.054]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_heu7k"]
|
||||
_data = {
|
||||
"Idle": SubResource("Animation_bymho"),
|
||||
"RESET": SubResource("Animation_c2ts8")
|
||||
}
|
||||
|
||||
[sub_resource type="Shader" id="Shader_mcoye"]
|
||||
resource_name = "VFEZ3DPreview"
|
||||
code = "
|
||||
// This shader was dynamically generated by the VFEZ material.
|
||||
// **********************************
|
||||
// Every change to the VFEZ material Render Options or
|
||||
// Include Options generates a new shader. After every change
|
||||
// you can click on the new exported shader in the editor to view
|
||||
// the latest changes. Only the definitions (#define) actually change.
|
||||
// **********************************
|
||||
shader_type spatial;
|
||||
#define BLEND_MIX
|
||||
#define DEPTH_DRAW_OPAQUE
|
||||
#define CULL_DISABLED
|
||||
#define DIFFUSE_LAMBERT
|
||||
#define SPECULAR_SCHLICK_GGX
|
||||
#define UNSHADED
|
||||
#define UV_PIXELATE
|
||||
#define UV_TWIST
|
||||
#define COLOR_RAMP
|
||||
#define ALPHA_MASK
|
||||
#define VERTEX_EXPAND
|
||||
#include \"res://addons/VFEZ-godot/Shaders/vfez_3d_template.gdshaderinc\"
|
||||
"
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_63ihy"]
|
||||
offsets = PackedFloat32Array(0.428058, 1)
|
||||
colors = PackedColorArray(1, 1, 1, 1, 0, 0, 0, 1)
|
||||
|
||||
[sub_resource type="GradientTexture2D" id="GradientTexture2D_r8kvc"]
|
||||
gradient = SubResource("Gradient_63ihy")
|
||||
fill = 1
|
||||
fill_from = Vector2(0.5, 0.5)
|
||||
fill_to = Vector2(0.209402, 0.282051)
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_ofkbo"]
|
||||
colors = PackedColorArray(1, 0, 0, 1, 1, 0.945098, 0, 1)
|
||||
|
||||
[sub_resource type="GradientTexture1D" id="GradientTexture1D_uakp7"]
|
||||
gradient = SubResource("Gradient_ofkbo")
|
||||
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_0oxa2"]
|
||||
|
||||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_gpq7r"]
|
||||
seamless = true
|
||||
noise = SubResource("FastNoiseLite_0oxa2")
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_1m7hj"]
|
||||
render_priority = 0
|
||||
shader = SubResource("Shader_mcoye")
|
||||
shader_parameter/global_color = Color(1, 1, 1, 1)
|
||||
shader_parameter/global_alpha = 1.0
|
||||
shader_parameter/additive_config = false
|
||||
shader_parameter/premultiply_color = true
|
||||
shader_parameter/premultiply_alpha = false
|
||||
shader_parameter/shape1_main_texture_scale = Vector2(1, 1)
|
||||
shader_parameter/shape1_main_texture_offset = Vector2(0, 0)
|
||||
shader_parameter/shape1_color = Color(1, 1, 1, 1)
|
||||
shader_parameter/shape1_red_as_alpha = false
|
||||
shader_parameter/shape1_scroll_speed = Vector2(0.48, 0)
|
||||
shader_parameter/shape1_rotation_offset = 0.0
|
||||
shader_parameter/shape1_rotation_speed = 0.0
|
||||
shader_parameter/shape1_main_texture = SubResource("NoiseTexture2D_gpq7r")
|
||||
shader_parameter/shape1_contrast = 1.902
|
||||
shader_parameter/shape1_brightness = 0.0
|
||||
shader_parameter/shape1_distortion_texture_scale = Vector2(1, 1)
|
||||
shader_parameter/shape1_distortion_texture_offset = Vector2(0, 0)
|
||||
shader_parameter/shape1_distortion_amount = 0.0
|
||||
shader_parameter/shape1_distortion_speed = Vector2(0, 0)
|
||||
shader_parameter/shape1_use_polar_uv = false
|
||||
shader_parameter/shape1_polar_uv_center = Vector2(0.5, 0.5)
|
||||
shader_parameter/shape1_distortion_polar_uvs = false
|
||||
shader_parameter/shape1_use_screenspace_uv = false
|
||||
shader_parameter/use_shape2 = false
|
||||
shader_parameter/use_shape3 = false
|
||||
shader_parameter/use_uv_pixelate = true
|
||||
shader_parameter/uv_pixelate_size = 128
|
||||
shader_parameter/use_uv_twist = true
|
||||
shader_parameter/uv_twist_amount = 1.0
|
||||
shader_parameter/uv_twist_pos_x = 0.5
|
||||
shader_parameter/uv_twist_pos_y = 0.5
|
||||
shader_parameter/uv_twist_radius = 0.318
|
||||
shader_parameter/use_uv_handrawn = false
|
||||
shader_parameter/use_uv_shake = false
|
||||
shader_parameter/use_uv_wave = false
|
||||
shader_parameter/use_uv_round_wave = false
|
||||
shader_parameter/use_uv_global_distortion = false
|
||||
shader_parameter/use_alpha_disolve = false
|
||||
shader_parameter/use_color_face_tint = false
|
||||
shader_parameter/use_color_toning = false
|
||||
shader_parameter/use_color_ramp = true
|
||||
shader_parameter/color_ramp_albedo = Color(1, 1, 1, 1)
|
||||
shader_parameter/color_ramp_luminosity = 0.0
|
||||
shader_parameter/color_ramp_blend = 1.0
|
||||
shader_parameter/color_ramp_texture = SubResource("GradientTexture1D_uakp7")
|
||||
shader_parameter/use_color_posterize = false
|
||||
shader_parameter/use_color_rim = false
|
||||
shader_parameter/use_color_glow = false
|
||||
shader_parameter/use_color_hsv_shift = false
|
||||
shader_parameter/use_alpha_mask = true
|
||||
shader_parameter/alpha_mask_scale = Vector2(1, 1)
|
||||
shader_parameter/alpha_mask_offset = Vector2(0, 0)
|
||||
shader_parameter/alpha_mask_power = 1.0
|
||||
shader_parameter/alpha_mask_texture = SubResource("GradientTexture2D_r8kvc")
|
||||
shader_parameter/use_alpha_remap = false
|
||||
shader_parameter/use_alpha_cutoff = false
|
||||
shader_parameter/use_vertex_offset = false
|
||||
shader_parameter/use_vertex_expand = true
|
||||
shader_parameter/vertex_expand_center = Vector3(0, 0, -0.48)
|
||||
shader_parameter/vertex_expand_ignore_center_vertical = false
|
||||
shader_parameter/vertex_expand_amount = 1.651
|
||||
shader_parameter/use_particle_trails = false
|
||||
shader_parameter/use_particle_anim = false
|
||||
script = ExtResource("1_o2hx6")
|
||||
BlendMode = 0
|
||||
DepthDrawMode = 0
|
||||
CullMode = 2
|
||||
DiffuseMode = 0
|
||||
SpecularMode = 0
|
||||
ShadingMode = 0
|
||||
BillboardMode = 0
|
||||
BillboardKeepScale = false
|
||||
NoDepthTest = false
|
||||
|
||||
[sub_resource type="QuadMesh" id="QuadMesh_6w7pd"]
|
||||
subdivide_width = 10
|
||||
subdivide_depth = 10
|
||||
|
||||
[sub_resource type="Environment" id="Environment_jicdf"]
|
||||
background_mode = 1
|
||||
background_color = Color(0.0862745, 0.301961, 0.85098, 1)
|
||||
glow_enabled = true
|
||||
glow_blend_mode = 1
|
||||
|
||||
[node name="VfezExamples" type="Node3D"]
|
||||
|
||||
[node name="BuffAura" type="Node3D" parent="."]
|
||||
transform = Transform3D(2.515, 0, 0, 0, 2.515, 0, 0, 0, 2.515, 0, 0, 0)
|
||||
|
||||
[node name="Base" type="MeshInstance3D" parent="BuffAura"]
|
||||
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0, 0)
|
||||
material_override = SubResource("ShaderMaterial_ncvk1")
|
||||
mesh = SubResource("QuadMesh_eyir6")
|
||||
skeleton = NodePath("../..")
|
||||
|
||||
[node name="Rings" type="MeshInstance3D" parent="BuffAura"]
|
||||
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0, 0)
|
||||
material_override = SubResource("ShaderMaterial_0wske")
|
||||
mesh = SubResource("QuadMesh_eyir6")
|
||||
skeleton = NodePath("../..")
|
||||
|
||||
[node name="GPUParticles3D" type="GPUParticles3D" parent="BuffAura"]
|
||||
transform = Transform3D(0.999929, 0, 0.0119552, 0, 1, 0, -0.0119552, 0, 0.999929, 0.00681505, 0, 0.0035185)
|
||||
material_override = SubResource("ShaderMaterial_wlr8l")
|
||||
amount = 60
|
||||
lifetime = 2.0
|
||||
randomness = 1.0
|
||||
process_material = SubResource("ParticleProcessMaterial_3e8fx")
|
||||
draw_pass_1 = SubResource("QuadMesh_t6fyf")
|
||||
|
||||
[node name="BurningSphere" type="Node3D" parent="."]
|
||||
transform = Transform3D(1.34, 0, 0, 0, 1.34, 0, 0, 0, 1.34, 0, 0, 2.90786)
|
||||
|
||||
[node name="SphereIn" type="MeshInstance3D" parent="BurningSphere"]
|
||||
material_override = SubResource("ShaderMaterial_d2148")
|
||||
mesh = SubResource("SphereMesh_x6q4p")
|
||||
|
||||
[node name="SphereOut" type="MeshInstance3D" parent="BurningSphere"]
|
||||
material_override = SubResource("ShaderMaterial_b7o1b")
|
||||
mesh = SubResource("SphereMesh_4wcxn")
|
||||
skeleton = NodePath("../..")
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="BurningSphere"]
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_heu7k")
|
||||
}
|
||||
autoplay = "Idle"
|
||||
|
||||
[node name="PixelTwist" type="Node3D" parent="."]
|
||||
|
||||
[node name="Twist" type="MeshInstance3D" parent="PixelTwist"]
|
||||
transform = Transform3D(0.0119552, 0, -0.999929, 0, 1, 0, 0.999929, 0, 0.0119552, 1.48031, 0, -2.86724)
|
||||
material_override = SubResource("ShaderMaterial_1m7hj")
|
||||
mesh = SubResource("QuadMesh_6w7pd")
|
||||
|
||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
||||
environment = SubResource("Environment_jicdf")
|
||||
|
||||
[node name="Camera3D" type="Camera3D" parent="."]
|
||||
transform = Transform3D(-4.37114e-08, 0.559193, -0.829038, 0, 0.829038, 0.559193, 1, 2.44431e-08, -3.62384e-08, -5.571, 3.38, 0)
|
||||
fov = 45.1
|
||||
123
VFEZ/vfez_material_2d.gd
Normal file
123
VFEZ/vfez_material_2d.gd
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
@tool
|
||||
extends ShaderMaterial
|
||||
class_name VFEZMaterial2D
|
||||
|
||||
enum BlendModeEnum
|
||||
{
|
||||
Mix = 0,
|
||||
Add = 1,
|
||||
Subtract = 2,
|
||||
Multiply = 3,
|
||||
Premultiplied_Alpha= 4
|
||||
}
|
||||
|
||||
enum LightModeEnum
|
||||
{
|
||||
Normal = 0,
|
||||
Unshaded = 1,
|
||||
LightOnly = 2
|
||||
}
|
||||
|
||||
@export_group("Render Options")
|
||||
@export var BlendMode: BlendModeEnum:
|
||||
get:
|
||||
return _blendMode
|
||||
set(value):
|
||||
_blendMode = value
|
||||
_update_shader_code()
|
||||
|
||||
@export var LightMode: LightModeEnum:
|
||||
get:
|
||||
return _lightMode
|
||||
set(value):
|
||||
_lightMode = value
|
||||
_update_shader_code()
|
||||
|
||||
var _blendMode: BlendModeEnum = BlendModeEnum.Mix
|
||||
var _lightMode: LightModeEnum = LightModeEnum.Normal
|
||||
|
||||
# handle property gets.
|
||||
# if is shader property set it in shader
|
||||
# and if it starts with use_ update shader code to include new definitions
|
||||
# if is render property set new value and update shader code
|
||||
func _set(property, value):
|
||||
if property.begins_with("shader_parameter/"):
|
||||
set_shader_parameter(property.replace("shader_parameter/", ""), value)
|
||||
if property.begins_with("shader_parameter/use_"):
|
||||
_update_shader_code()
|
||||
|
||||
func generate_render_options_definition_string() -> String:
|
||||
var definition_string: String = ""
|
||||
|
||||
match _blendMode:
|
||||
BlendModeEnum.Mix:
|
||||
definition_string += "#define BLEND_MIX\n"
|
||||
BlendModeEnum.Add:
|
||||
definition_string += "#define BLEND_ADD\n"
|
||||
BlendModeEnum.Subtract:
|
||||
definition_string += "#define BLEND_SUB\n"
|
||||
BlendModeEnum.Multiply:
|
||||
definition_string += "#define BLEND_MUL\n"
|
||||
BlendModeEnum.Premultiplied_Alpha:
|
||||
definition_string += "#define BLEND_PREMUL_ALPHA\n"
|
||||
|
||||
match _lightMode:
|
||||
LightModeEnum.Unshaded:
|
||||
definition_string += "#define UNSHADED\n"
|
||||
LightModeEnum.LightOnly:
|
||||
definition_string += "#define LIGHT_ONLY\n"
|
||||
|
||||
return definition_string
|
||||
|
||||
# update shader code to include new option definitions
|
||||
func _update_shader_code():
|
||||
if not Engine.is_editor_hint():
|
||||
return
|
||||
|
||||
var template_header = """
|
||||
// This shader was dynamically generated by the VFEZ material.
|
||||
// **********************************
|
||||
// Every change to the VFEZ material Render Options or
|
||||
// Include Options generates a new shader. After every change
|
||||
// you can click on the new exported shader in the editor to view
|
||||
// the latest changes. Only the definitions (#define) actually change.
|
||||
// **********************************
|
||||
"""
|
||||
# find current directory name and create absolute include path for template shader
|
||||
var base_dir_name = get_script().get_path().get_base_dir()
|
||||
var shader_include_str: String = "#include \"" + base_dir_name + "/Shaders/vfez_2d_template.gdshaderinc\"\n"
|
||||
var template_code: String = "shader_type canvas_item;\n"
|
||||
|
||||
# we duplicate the shader, else the code bugs
|
||||
# if the generated shader is open in the editor
|
||||
shader = shader.duplicate()
|
||||
# initialize the shader code with the included shader template.
|
||||
# This is necessary to be able to read the shader uniforms later.
|
||||
shader.code = template_code + shader_include_str
|
||||
|
||||
template_code += generate_render_options_definition_string()
|
||||
|
||||
# set all shader definition options based on the relevant use_X uniform values
|
||||
for uniform in shader.get_shader_uniform_list():
|
||||
var uniform_name: String = uniform["name"]
|
||||
|
||||
# if start with use_ there is a relevant define options
|
||||
if uniform_name.begins_with("use_"):
|
||||
var shader_parameter = get_shader_parameter(uniform_name)
|
||||
# if use_ shader parameter is true (1) then set the define option
|
||||
# to enable the effect
|
||||
if shader_parameter != null && int(shader_parameter) == 1:
|
||||
# extract define option from shader_parameter name
|
||||
# for example use_uv_wave becomes -> UV_WAVE
|
||||
var define_option = uniform_name.replace("use_", "").to_upper()
|
||||
template_code += "#define %s\n" % define_option
|
||||
|
||||
# update final code to include description template, the define options
|
||||
# and the shader include string at the end
|
||||
shader.code = template_header + template_code + shader_include_str
|
||||
|
||||
func _init() -> void:
|
||||
if Engine.is_editor_hint():
|
||||
shader = Shader.new()
|
||||
shader.resource_name = "VFEZ2DPreview"
|
||||
_update_shader_code()
|
||||
262
VFEZ/vfez_material_3d.gd
Normal file
262
VFEZ/vfez_material_3d.gd
Normal file
|
|
@ -0,0 +1,262 @@
|
|||
@tool
|
||||
extends ShaderMaterial
|
||||
class_name VFEZMaterial3D
|
||||
|
||||
enum BlendModeEnum
|
||||
{
|
||||
Mix = 0,
|
||||
Add = 1,
|
||||
Subtract = 2,
|
||||
Multiply = 3,
|
||||
Premultiplied_Alpha= 4
|
||||
}
|
||||
|
||||
enum DepthDrawModeEnum
|
||||
{
|
||||
Opaque = 0,
|
||||
Always = 1,
|
||||
Never = 2
|
||||
}
|
||||
|
||||
enum CullModeEnum
|
||||
{
|
||||
Back = 0,
|
||||
Front = 1,
|
||||
Disabled = 2
|
||||
}
|
||||
|
||||
enum DiffuseModeEnum
|
||||
{
|
||||
Lambert = 0,
|
||||
Lambert_Wrap = 1,
|
||||
Burley = 2,
|
||||
Toon = 3,
|
||||
}
|
||||
|
||||
enum SpecularModeEnum
|
||||
{
|
||||
Schlick_Ggx = 0,
|
||||
Toon = 1,
|
||||
Disabled = 2
|
||||
}
|
||||
|
||||
enum ShadingModeEnum
|
||||
{
|
||||
Unshaded = 0,
|
||||
Shaded = 1
|
||||
}
|
||||
|
||||
enum BillboardModeEnum
|
||||
{
|
||||
Disabled = 0,
|
||||
Enabled = 1,
|
||||
Y = 2,
|
||||
Particle = 3,
|
||||
}
|
||||
|
||||
|
||||
@export_group("Render Options")
|
||||
@export var BlendMode: BlendModeEnum:
|
||||
get:
|
||||
return _blendMode
|
||||
set(value):
|
||||
_blendMode = value
|
||||
_update_shader_code()
|
||||
|
||||
@export var DepthDrawMode: DepthDrawModeEnum:
|
||||
get:
|
||||
return _depthDrawMode
|
||||
set(value):
|
||||
_depthDrawMode = value
|
||||
_update_shader_code()
|
||||
|
||||
@export var CullMode: CullModeEnum:
|
||||
get:
|
||||
return _cullMode
|
||||
set(value):
|
||||
_cullMode = value
|
||||
_update_shader_code()
|
||||
|
||||
@export var DiffuseMode: DiffuseModeEnum:
|
||||
get:
|
||||
return _diffuseMode
|
||||
set(value):
|
||||
_diffuseMode = value
|
||||
_update_shader_code()
|
||||
|
||||
@export var SpecularMode: SpecularModeEnum:
|
||||
get:
|
||||
return _specularMode
|
||||
set(value):
|
||||
_specularMode = value
|
||||
_update_shader_code()
|
||||
|
||||
@export var ShadingMode: ShadingModeEnum:
|
||||
get:
|
||||
return _shadingMode
|
||||
set(value):
|
||||
_shadingMode = value
|
||||
_update_shader_code()
|
||||
|
||||
@export var BillboardMode: BillboardModeEnum:
|
||||
get:
|
||||
return _billboardMode
|
||||
set(value):
|
||||
_billboardMode = value
|
||||
_update_shader_code()
|
||||
|
||||
@export var BillboardKeepScale: bool:
|
||||
get:
|
||||
return _billboardKeepScale
|
||||
set(value):
|
||||
_billboardKeepScale = value
|
||||
_update_shader_code()
|
||||
|
||||
@export var NoDepthTest: bool:
|
||||
get:
|
||||
return _noDepthTest
|
||||
set(value):
|
||||
_noDepthTest = value
|
||||
_update_shader_code()
|
||||
|
||||
var _blendMode: BlendModeEnum = BlendModeEnum.Mix
|
||||
var _depthDrawMode: DepthDrawModeEnum = DepthDrawModeEnum.Opaque
|
||||
var _cullMode: CullModeEnum = CullModeEnum.Back
|
||||
var _diffuseMode: DiffuseModeEnum = DiffuseModeEnum.Lambert
|
||||
var _specularMode: SpecularModeEnum = SpecularModeEnum.Schlick_Ggx
|
||||
var _shadingMode: ShadingModeEnum = ShadingModeEnum.Unshaded
|
||||
var _billboardMode: BillboardModeEnum = BillboardModeEnum.Disabled
|
||||
var _billboardKeepScale: bool
|
||||
var _noDepthTest: bool
|
||||
|
||||
# handle property gets.
|
||||
# if is shader property set it in shader
|
||||
# and if it starts with use_ update shader code to include new definitions
|
||||
# if is render property set new value and update shader code
|
||||
func _set(property, value):
|
||||
if property.begins_with("shader_parameter/"):
|
||||
set_shader_parameter(property.replace("shader_parameter/", ""), value)
|
||||
if property.begins_with("shader_parameter/use_"):
|
||||
_update_shader_code()
|
||||
|
||||
func generate_render_options_definition_string() -> String:
|
||||
var definition_string: String = ""
|
||||
|
||||
match _blendMode:
|
||||
BlendModeEnum.Mix:
|
||||
definition_string += "#define BLEND_MIX\n"
|
||||
BlendModeEnum.Add:
|
||||
definition_string += "#define BLEND_ADD\n"
|
||||
BlendModeEnum.Subtract:
|
||||
definition_string += "#define BLEND_SUB\n"
|
||||
BlendModeEnum.Multiply:
|
||||
definition_string += "#define BLEND_MUL\n"
|
||||
BlendModeEnum.Premultiplied_Alpha:
|
||||
definition_string += "#define BLEND_PREMUL_ALPHA\n"
|
||||
|
||||
match _depthDrawMode:
|
||||
DepthDrawModeEnum.Opaque:
|
||||
definition_string += "#define DEPTH_DRAW_OPAQUE\n"
|
||||
DepthDrawModeEnum.Always:
|
||||
definition_string += "#define DEPTH_DRAW_ALWAYS\n"
|
||||
DepthDrawModeEnum.Never:
|
||||
definition_string += "#define DEPTH_DRAW_NEVER\n"
|
||||
|
||||
match _cullMode:
|
||||
CullModeEnum.Back:
|
||||
definition_string += "#define CULL_BACK\n"
|
||||
CullModeEnum.Front:
|
||||
definition_string += "#define CULL_FRONT\n"
|
||||
CullModeEnum.Disabled:
|
||||
definition_string += "#define CULL_DISABLED\n"
|
||||
|
||||
match _diffuseMode:
|
||||
DiffuseModeEnum.Lambert:
|
||||
definition_string += "#define DIFFUSE_LAMBERT\n"
|
||||
DiffuseModeEnum.Lambert_Wrap:
|
||||
definition_string += "#define DIFFUSE_LABERT_WRAP\n"
|
||||
DiffuseModeEnum.Burley:
|
||||
definition_string += "#define DIFFUSE_BURLEY\n"
|
||||
DiffuseModeEnum.Toon:
|
||||
definition_string += "#define DIFFUSE_TOON\n"
|
||||
|
||||
match _specularMode:
|
||||
SpecularModeEnum.Schlick_Ggx:
|
||||
definition_string += "#define SPECULAR_SCHLICK_GGX\n"
|
||||
SpecularModeEnum.Toon:
|
||||
definition_string += "#define SPECULAR_TOON\n"
|
||||
SpecularModeEnum.Disabled:
|
||||
definition_string += "#define SPECULAR_DISABLED\n"
|
||||
|
||||
match _shadingMode:
|
||||
ShadingModeEnum.Unshaded:
|
||||
definition_string += "#define UNSHADED\n"
|
||||
|
||||
match _billboardMode:
|
||||
BillboardModeEnum.Enabled:
|
||||
definition_string += "#define BILLBOARD_ENABLED\n"
|
||||
BillboardModeEnum.Y:
|
||||
definition_string += "#define BILLBOARD_Y\n"
|
||||
BillboardModeEnum.Particle:
|
||||
definition_string += "#define BILLBOARD_PARTICLE\n"
|
||||
|
||||
if _noDepthTest:
|
||||
definition_string += "#define NO_DEPTH_TEST\n"
|
||||
|
||||
if _billboardKeepScale:
|
||||
definition_string += "#define BILLBOARD_KEEP_SCALE\n"
|
||||
|
||||
return definition_string
|
||||
|
||||
# update shader code to include new option definitions
|
||||
func _update_shader_code():
|
||||
if not Engine.is_editor_hint():
|
||||
return
|
||||
|
||||
var template_header = """
|
||||
// This shader was dynamically generated by the VFEZ material.
|
||||
// **********************************
|
||||
// Every change to the VFEZ material Render Options or
|
||||
// Include Options generates a new shader. After every change
|
||||
// you can click on the new exported shader in the editor to view
|
||||
// the latest changes. Only the definitions (#define) actually change.
|
||||
// **********************************
|
||||
"""
|
||||
# find current directory name and create absolute include path for template shader
|
||||
var base_dir_name = get_script().get_path().get_base_dir()
|
||||
var shader_include_str: String = "#include \"" + base_dir_name + "/Shaders/vfez_3d_template.gdshaderinc\"\n"
|
||||
var template_code: String = "shader_type spatial;\n"
|
||||
|
||||
# we duplicate the shader, else the code bugs
|
||||
# if the generated shader is open in the editor
|
||||
shader = shader.duplicate()
|
||||
# initialize the shader code with the included shader template.
|
||||
# This is necessary to be able to read the shader uniforms later.
|
||||
shader.code = template_code + shader_include_str
|
||||
|
||||
template_code += generate_render_options_definition_string()
|
||||
|
||||
# set all shader definition options based on the relevant use_X uniform values
|
||||
for uniform in shader.get_shader_uniform_list():
|
||||
var uniform_name: String = uniform["name"]
|
||||
|
||||
# if start with use_ there is a relevant define options
|
||||
if uniform_name.begins_with("use_"):
|
||||
var shader_parameter = get_shader_parameter(uniform_name)
|
||||
# if use_ shader parameter is true (1) then set the define option
|
||||
# to enable the effect
|
||||
if shader_parameter != null && int(shader_parameter) == 1:
|
||||
# extract define option from shader_parameter name
|
||||
# for example use_uv_wave becomes -> UV_WAVE
|
||||
var define_option = uniform_name.replace("use_", "").to_upper()
|
||||
template_code += "#define %s\n" % define_option
|
||||
|
||||
# update final code to include description template, the define options
|
||||
# and the shader include string at the end
|
||||
shader.code = template_header + template_code + shader_include_str
|
||||
|
||||
func _init() -> void:
|
||||
if Engine.is_editor_hint():
|
||||
shader = Shader.new()
|
||||
shader.resource_name = "VFEZ3DPreview"
|
||||
_update_shader_code()
|
||||
Loading…
Add table
Add a link
Reference in a new issue