Pixel-Composer/scripts/node_FXAA/node_FXAA.gml

38 lines
1.0 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-18 06:16:20 +02:00
newInput(0, nodeValue_Surface("Surface in", self));
2023-05-03 21:42:17 +02:00
2024-08-18 06:16:20 +02:00
newInput(1, nodeValue_Bool("Active", self, true));
2023-06-17 14:30:49 +02:00
2024-08-08 06:57:51 +02:00
inputs[2] = nodeValue_Float("Distance", self, 0.5)
2024-05-07 12:40:18 +02:00
.setDisplay(VALUE_DISPLAY.slider);
2024-08-08 06:57:51 +02:00
inputs[3] = nodeValue_Float("Mix", self, 1)
2024-05-07 12:40:18 +02:00
.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
]
2024-08-08 06:57:51 +02:00
outputs[0] = nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone);
2023-05-03 21:42:17 +02:00
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
}