Pixel-Composer/scripts/node_tonemap_ace/node_tonemap_ace.gml

42 lines
1.1 KiB
Plaintext
Raw Normal View History

2024-05-15 14:27:09 +02:00
function Node_Tonemap_ACE(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
name = "ACE";
2024-08-08 06:57:51 +02:00
inputs[0] = nodeValue_Surface("Surface in", self);
2024-05-15 14:27:09 +02:00
2024-08-08 06:57:51 +02:00
inputs[1] = nodeValue_Surface("Mask", self);
2024-05-15 14:27:09 +02:00
2024-08-08 06:57:51 +02:00
inputs[2] = nodeValue_Float("Mix", self, 1)
2024-05-15 14:27:09 +02:00
.setDisplay(VALUE_DISPLAY.slider);
2024-08-08 06:57:51 +02:00
inputs[3] = nodeValue_Bool("Active", self, true);
2024-05-15 14:27:09 +02:00
active_index = 3;
2024-08-08 06:57:51 +02:00
inputs[4] = nodeValue_Toggle("Channel", self, 0b1111, { data: array_create(4, THEME.inspector_channel) });
2024-05-15 14:27:09 +02:00
__init_mask_modifier(1); // inputs 5, 6
input_display_list = [ 3, 4,
["Surfaces", true], 0, 1, 2, 5, 6,
]
2024-08-08 06:57:51 +02:00
outputs[0] = nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone);
2024-05-15 14:27:09 +02:00
attribute_surface_depth();
2024-07-22 07:10:46 +02:00
static step = function() {
2024-05-15 14:27:09 +02:00
__step_mask_modifier();
2024-07-22 07:10:46 +02:00
}
2024-05-15 14:27:09 +02:00
2024-07-22 07:10:46 +02:00
static processData = function(_outSurf, _data, _output_index, _array_index) {
2024-05-15 14:27:09 +02:00
surface_set_shader(_outSurf, sh_ace);
draw_surface_safe(_data[0]);
surface_reset_shader();
__process_mask_modifier(_data);
_outSurf = mask_apply(_data[0], _outSurf, _data[1], _data[2]);
_outSurf = channel_apply(_data[0], _outSurf, _data[4]);
return _outSurf;
2024-07-22 07:10:46 +02:00
}
2024-05-15 14:27:09 +02:00
}