Pixel-Composer/scripts/node_FXAA/node_FXAA.gml

38 lines
1.2 KiB
Plaintext
Raw Normal View History

2023-05-03 21:42:17 +02:00
function Node_FXAA(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
name = "FXAA";
2024-08-07 11:48:39 +02:00
inputs[| 0] = nodeValue_Surface("Surface in", self);
2023-05-03 21:42:17 +02:00
2023-06-17 14:30:49 +02:00
inputs[| 1] = nodeValue("Active", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true);
2024-05-07 12:40:18 +02:00
inputs[| 2] = nodeValue("Distance", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.5)
.setDisplay(VALUE_DISPLAY.slider);
inputs[| 3] = nodeValue("Mix", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1)
.setDisplay(VALUE_DISPLAY.slider);
2023-06-17 14:30:49 +02:00
active_index = 1;
2023-05-03 21:42:17 +02:00
input_display_list = [
2023-06-17 14:30:49 +02:00
1, 0,
2024-05-07 12:40:18 +02:00
["Effect", false], 2, 3,
2023-05-03 21:42:17 +02:00
]
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
attribute_surface_depth();
2023-09-14 16:29:39 +02:00
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
2023-05-03 21:42:17 +02:00
surface_set_shader(_outSurf, sh_FXAA);
gpu_set_tex_filter(true);
2023-09-08 21:37:36 +02:00
shader_set_f("dimension", surface_get_width_safe(_data[0]), surface_get_height_safe(_data[0]));
2024-05-07 12:40:18 +02:00
shader_set_f("cornerDis", _data[2]);
shader_set_f("mixAmo", _data[3]);
draw_surface_safe(_data[0]);
2023-05-03 21:42:17 +02:00
gpu_set_tex_filter(false);
surface_reset_shader();
return _outSurf;
2023-09-14 16:29:39 +02:00
} #endregion
2023-05-03 21:42:17 +02:00
}