mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-12-23 21:46:17 +01:00
macos directional shadow fix
This commit is contained in:
parent
96ba8d4ac9
commit
c898fd3f99
36 changed files with 160 additions and 100 deletions
|
@ -29,7 +29,7 @@ if !target exit;
|
|||
var by = dialog_y + ui(18);
|
||||
|
||||
if(buttonInstant(THEME.button_hide, bx, by, bw, bh, mouse_ui, sFOCUS, sHOVER, __txt("Add") + "...", THEME.add,, COLORS._main_value_positive) == 2) {
|
||||
var path = get_open_filenames_compat(".png", "");
|
||||
var path = get_open_filenames_compat("image|*.png;*.jpg", "");
|
||||
key_release();
|
||||
if(path != "") {
|
||||
var paths = paths_to_array(path);
|
||||
|
|
|
@ -185,7 +185,7 @@ if palette == 0 exit;
|
|||
|
||||
bx = content_x + ui(18);
|
||||
if(buttonInstant(THEME.button, bx, by, ui(28), ui(28), mouse_ui, interactable && sFOCUS, sHOVER, __txtx("palette_editor_load", "Load palette file") + " (.hex)", THEME.file) == 2) {
|
||||
var path = get_open_filename(".hex", "");
|
||||
var path = get_open_filename("HEX palette|*.hex", "");
|
||||
key_release();
|
||||
|
||||
if(isPaletteFile(path)) {
|
||||
|
|
|
@ -5,7 +5,7 @@ function __Node_3D_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
|||
.setVisible(true, true);
|
||||
|
||||
inputs[| 1] = nodeValue("Path", self, JUNCTION_CONNECT.input, VALUE_TYPE.path, "", "Export location without '.obj' extension." )
|
||||
.setDisplay(VALUE_DISPLAY.path_save, { filter: "*.obj" });
|
||||
.setDisplay(VALUE_DISPLAY.path_save, { filter: "3d object|*.obj" });
|
||||
|
||||
inputs[| 2] = nodeValue("Export texture", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true );
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ function __Node_3D_Obj(_x, _y, _group = noone) : Node(_x, _y, _group) constructo
|
|||
name = "3D Object";
|
||||
|
||||
inputs[| 0] = nodeValue("Path", self, JUNCTION_CONNECT.input, VALUE_TYPE.path, "")
|
||||
.setDisplay(VALUE_DISPLAY.path_load, { filter: "*.obj" })
|
||||
.setDisplay(VALUE_DISPLAY.path_load, { filter: "3d object|*.obj" })
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 1] = nodeValue("Generate", self, JUNCTION_CONNECT.input, VALUE_TYPE.trigger, 0)
|
||||
|
|
|
@ -52,7 +52,7 @@ function __3dLightDirectional() : __3dLight() constructor {
|
|||
} #endregion
|
||||
|
||||
static shadowProjectBegin = function() { #region
|
||||
shadow_map = surface_verify(shadow_map, shadow_map_size, shadow_map_size, surface_r32float);
|
||||
shadow_map = surface_verify(shadow_map, shadow_map_size, shadow_map_size, OS == os_macosx? surface_rgba8unorm : surface_r32float);
|
||||
|
||||
shadow_map_view = matrix_build_lookat(transform.position.x, transform.position.y, transform.position.z, 0, 0, 0, 0, 0, -1);
|
||||
shadow_map_proj = matrix_build_projection_ortho(shadow_map_scale, shadow_map_scale, .01, 100);
|
||||
|
|
|
@ -236,17 +236,21 @@ function __3dScene(camera, name = "New scene") constructor {
|
|||
shader_set_f("light_pnt_color", lightPnt_color);
|
||||
shader_set_f("light_pnt_intensity", lightPnt_intensity);
|
||||
shader_set_f("light_pnt_radius", lightPnt_radius);
|
||||
|
||||
shader_set_i("light_pnt_shadow_active", lightPnt_shadow);
|
||||
for( var i = 0, n = array_length(lightPnt_shadowMap); i < n; i++ ) {
|
||||
var _sid = shader_set_surface($"light_pnt_shadowmap_{i}", lightPnt_shadowMap[i], true, true);
|
||||
gpu_set_tex_repeat_ext(_sid, false);
|
||||
|
||||
if(OS == os_windows) {
|
||||
for( var i = 0, n = array_length(lightPnt_shadowMap); i < n; i++ ) {
|
||||
var _sid = shader_set_surface($"light_pnt_shadowmap_{i}", lightPnt_shadowMap[i], true, true);
|
||||
gpu_set_tex_repeat_ext(_sid, false);
|
||||
}
|
||||
shader_set_f("light_pnt_view", lightPnt_viewMat);
|
||||
shader_set_f("light_pnt_proj", lightPnt_projMat);
|
||||
shader_set_f("light_pnt_shadow_bias", lightPnt_shadowBias);
|
||||
}
|
||||
shader_set_f("light_pnt_view", lightPnt_viewMat);
|
||||
shader_set_f("light_pnt_proj", lightPnt_projMat);
|
||||
shader_set_f("light_pnt_shadow_bias", lightPnt_shadowBias);
|
||||
} #endregion
|
||||
|
||||
if(defer_normal && deferData != noone && array_length(deferData.geometry_data) > 2) {
|
||||
if(OS == os_windows && defer_normal && deferData != noone && array_length(deferData.geometry_data) > 2) {
|
||||
shader_set_i("mat_defer_normal", 1);
|
||||
shader_set_surface("mat_normal_map", deferData.geometry_data[2]);
|
||||
} else
|
||||
|
@ -303,7 +307,7 @@ function __3dScene(camera, name = "New scene") constructor {
|
|||
|
||||
array_push(lightPnt_intensity, light.intensity);
|
||||
array_push(lightPnt_radius, light.radius);
|
||||
array_push(lightPnt_shadow, light.shadow_active);
|
||||
array_push(lightPnt_shadow, OS == os_windows && light.shadow_active);
|
||||
|
||||
if(light.shadow_active) {
|
||||
if(lightPnt_shadow_count < lightPnt_shadow_max) {
|
||||
|
|
|
@ -110,6 +110,24 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc
|
|||
lb_w += ui(24);
|
||||
} #endregion
|
||||
|
||||
if(!jun.active) {
|
||||
draw_set_text(_font, fa_left, fa_center, COLORS._main_text_sub_inner);
|
||||
draw_text_add(lb_x, lb_y - ui(2), _name);
|
||||
|
||||
if(jun.active_tooltip != "") {
|
||||
var tx = xx + ui(40) + string_width(_name) + ui(16);
|
||||
var ty = lb_y - ui(1);
|
||||
|
||||
if(point_in_circle(_m[0], _m[1], tx, ty, ui(10))) {
|
||||
TOOLTIP = jun.active_tooltip;
|
||||
draw_sprite_ui(THEME.info, 0, tx, ty,,,, COLORS._main_icon_light, 1);
|
||||
} else
|
||||
draw_sprite_ui(THEME.info, 0, tx, ty,,,, COLORS._main_icon_light, 0.75);
|
||||
}
|
||||
|
||||
return [ 0, true ];
|
||||
}
|
||||
|
||||
draw_text_add(lb_x, lb_y - ui(2), _name);
|
||||
|
||||
#region tooltip
|
||||
|
|
|
@ -72,7 +72,8 @@ function Node_3D_Camera(_x, _y, _group = noone) : Node_3D_Object(_x, _y, _group)
|
|||
inputs[| in_d3d + 20] = nodeValue("AO Strength", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1. )
|
||||
.setDisplay(VALUE_DISPLAY.slider, { range: [ 0.01, 4, 0.01 ] });
|
||||
|
||||
inputs[| in_d3d + 21] = nodeValue("Round Normal", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0 );
|
||||
inputs[| in_d3d + 21] = nodeValue("Round Normal", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0 )
|
||||
.setWindows();
|
||||
|
||||
in_cam = ds_list_size(inputs);
|
||||
|
||||
|
|
|
@ -5,11 +5,14 @@ function Node_3D_Light_Point(_x, _y, _group = noone) : Node_3D_Light(_x, _y, _gr
|
|||
|
||||
inputs[| in_light + 0] = nodeValue("Radius", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 4)
|
||||
|
||||
inputs[| in_light + 1] = nodeValue("Cast Shadow", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false);
|
||||
inputs[| in_light + 1] = nodeValue("Cast Shadow", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false)
|
||||
.setWindows();
|
||||
|
||||
inputs[| in_light + 2] = nodeValue("Shadow Map Size", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 1024);
|
||||
inputs[| in_light + 2] = nodeValue("Shadow Map Size", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 1024)
|
||||
.setWindows();
|
||||
|
||||
inputs[| in_light + 3] = nodeValue("Shadow Bias", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, .001);
|
||||
inputs[| in_light + 3] = nodeValue("Shadow Bias", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, .001)
|
||||
.setWindows();
|
||||
|
||||
input_display_list = [
|
||||
["Transform", false], 0,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_create_3D_Obj(_x, _y, _group = noone) { #region
|
||||
var path = "";
|
||||
if(!LOADING && !APPENDING && !CLONING) {
|
||||
path = get_open_filename(".obj", "");
|
||||
path = get_open_filename("30 object|*.obj", "");
|
||||
key_release();
|
||||
if(path == "") return noone;
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ function Node_3D_Mesh_Obj(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y, _group)
|
|||
object_class = __3dObject;
|
||||
|
||||
inputs[| in_mesh + 0] = nodeValue("File Path", self, JUNCTION_CONNECT.input, VALUE_TYPE.path, "" )
|
||||
.setDisplay(VALUE_DISPLAY.path_load, { filter: "*.obj" })
|
||||
.setDisplay(VALUE_DISPLAY.path_load, { filter: "3d object|*.obj" })
|
||||
.rejectArray();
|
||||
|
||||
inputs[| in_mesh + 1] = nodeValue("Flip UV", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true, "Flip UV axis, can be use to fix some texture mapping error.")
|
||||
|
|
|
@ -103,7 +103,7 @@ function Node_3D_Transform_Image(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y,
|
|||
if(!previewable) return;
|
||||
|
||||
var _surf = outputs[| 1].getValue();
|
||||
if(is_array(_surf)) _surf = array_safe_get(_surf[preview_index]);
|
||||
if(is_array(_surf)) _surf = array_safe_get(_surf, preview_index);
|
||||
if(!is_surface(_surf)) return;
|
||||
|
||||
var bbox = drawGetBbox(xx, yy, _s);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_create_ASE_File_Read(_x, _y, _group = noone) { #region
|
||||
var path = "";
|
||||
if(!LOADING && !APPENDING && !CLONING) {
|
||||
path = get_open_filename(".ase", "");
|
||||
path = get_open_filename("aseprite|*.ase", "");
|
||||
key_release();
|
||||
if(path == "") return noone;
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
|||
w = 128;
|
||||
|
||||
inputs[| 0] = nodeValue("Path", self, JUNCTION_CONNECT.input, VALUE_TYPE.path, "")
|
||||
.setDisplay(VALUE_DISPLAY.path_load, { filter: "*.ase, *.aseprite" });
|
||||
.setDisplay(VALUE_DISPLAY.path_load, { filter: "Aseprite file|*.ase;*.aseprite" });
|
||||
|
||||
inputs[| 1] = nodeValue("Generate layers", self, JUNCTION_CONNECT.input, VALUE_TYPE.trigger, 0)
|
||||
.setDisplay(VALUE_DISPLAY.button, { name: "Generate", onClick: function() { refreshLayers(); } });
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_create_CSV_File_Read(_x, _y, _group = noone) { #region
|
||||
var path = "";
|
||||
if(!LOADING && !APPENDING && !CLONING) {
|
||||
path = get_open_filename(".csv", "");
|
||||
path = get_open_filename("comma separated value|*.csv", "");
|
||||
key_release();
|
||||
if(path == "") return noone;
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ function Node_CSV_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
|||
w = 128;
|
||||
|
||||
inputs[| 0] = nodeValue("Path", self, JUNCTION_CONNECT.input, VALUE_TYPE.path, "")
|
||||
.setDisplay(VALUE_DISPLAY.path_load, { filter: "*.csv" })
|
||||
.setDisplay(VALUE_DISPLAY.path_load, { filter: "CSV file|*.csv" })
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 1] = nodeValue("Convert to number", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false)
|
||||
|
|
|
@ -15,7 +15,7 @@ function Node_CSV_File_Write(_x, _y, _group = noone) : Node(_x, _y, _group) cons
|
|||
w = 128;
|
||||
|
||||
inputs[| 0] = nodeValue("Path", self, JUNCTION_CONNECT.input, VALUE_TYPE.path, "")
|
||||
.setDisplay(VALUE_DISPLAY.path_save, { filter: "*.csv" })
|
||||
.setDisplay(VALUE_DISPLAY.path_save, { filter: "csv file|*.csv" })
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 1] = nodeValue("Content", self, JUNCTION_CONNECT.input, VALUE_TYPE.any, "")
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_create_Display_Image(_x, _y, _group = noone) { #region
|
||||
var path = "";
|
||||
if(!LOADING && !APPENDING && !CLONING) {
|
||||
path = get_open_filename(".png", "");
|
||||
path = get_open_filename("image|*.png;*.jpg", "");
|
||||
key_release();
|
||||
if(path == "") return noone;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ function Node_Display_Image(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
|||
|
||||
inputs[| 0] = nodeValue("Path", self, JUNCTION_CONNECT.input, VALUE_TYPE.path, "")
|
||||
.setVisible(false)
|
||||
.setDisplay(VALUE_DISPLAY.path_load, { filter: "*.png" })
|
||||
.setDisplay(VALUE_DISPLAY.path_load, { filter: "image|*.png;*.jpg" })
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 1] = nodeValue("Position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ x, y ])
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_create_Image(_x, _y, _group = noone) {
|
||||
var path = "";
|
||||
if(!LOADING && !APPENDING && !CLONING) {
|
||||
path = get_open_filename(".png", "");
|
||||
path = get_open_filename("image|*.png;*.jpg", "");
|
||||
key_release();
|
||||
if(path == "") return noone;
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ function Node_Image(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
|||
color = COLORS.node_blend_input;
|
||||
|
||||
inputs[| 0] = nodeValue("Path", self, JUNCTION_CONNECT.input, VALUE_TYPE.path, "")
|
||||
.setDisplay(VALUE_DISPLAY.path_load, { filter: "*.png" })
|
||||
.setDisplay(VALUE_DISPLAY.path_load, { filter: "image|*.png;*.jpg" })
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 1] = nodeValue("Padding", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [0, 0, 0, 0])
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_create_Image_Animated(_x, _y, _group = noone) { #region
|
||||
var path = "";
|
||||
if(!LOADING && !APPENDING && !CLONING) {
|
||||
path = get_open_filenames_compat(".png", "");
|
||||
path = get_open_filenames_compat("image|*.png;*.jpg", "");
|
||||
key_release();
|
||||
if(path == "") return noone;
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ function Node_Image_Animated(_x, _y, _group = noone) : Node(_x, _y, _group) cons
|
|||
update_on_frame = true;
|
||||
|
||||
inputs[| 0] = nodeValue("Path", self, JUNCTION_CONNECT.input, VALUE_TYPE.path, [])
|
||||
.setDisplay(VALUE_DISPLAY.path_array, { filter: ["*.png", ""] });
|
||||
.setDisplay(VALUE_DISPLAY.path_array, { filter: ["image|*.png;*.jpg", ""] });
|
||||
|
||||
inputs[| 1] = nodeValue("Padding", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [0, 0, 0, 0])
|
||||
.setDisplay(VALUE_DISPLAY.padding)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_create_Image_gif(_x, _y, _group = noone) { #region
|
||||
var path = "";
|
||||
if(!LOADING && !APPENDING && !CLONING) {
|
||||
path = get_open_filename(".gif", "");
|
||||
path = get_open_filename("animated gif|*.gif", "");
|
||||
key_release();
|
||||
if(path == "") return noone;
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ function Node_Image_gif(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
|||
update_on_frame = true;
|
||||
|
||||
inputs[| 0] = nodeValue("Path", self, JUNCTION_CONNECT.input, VALUE_TYPE.path, "")
|
||||
.setDisplay(VALUE_DISPLAY.path_load, { filter: "*.gif" });
|
||||
.setDisplay(VALUE_DISPLAY.path_load, { filter: "Animated gif|*.gif" });
|
||||
|
||||
inputs[| 1] = nodeValue("Set animation length to gif", self, JUNCTION_CONNECT.input, VALUE_TYPE.trigger, 0)
|
||||
.setDisplay(VALUE_DISPLAY.button, { name: "Match length", onClick: function() {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_create_Image_Sequence(_x, _y, _group = noone) {
|
||||
var path = "";
|
||||
if(!LOADING && !APPENDING && !CLONING) {
|
||||
path = get_open_filenames_compat(".png", "");
|
||||
path = get_open_filenames_compat("image|*.png;*.jpg", "");
|
||||
key_release();
|
||||
if(path == "") return noone;
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ function Node_Image_Sequence(_x, _y, _group = noone) : Node(_x, _y, _group) cons
|
|||
color = COLORS.node_blend_input;
|
||||
|
||||
inputs[| 0] = nodeValue("Path", self, JUNCTION_CONNECT.input, VALUE_TYPE.path, [])
|
||||
.setDisplay(VALUE_DISPLAY.path_array, { filter: ["*.png", ""] });
|
||||
.setDisplay(VALUE_DISPLAY.path_array, { filter: ["image|*.png;*.jpg", ""] });
|
||||
|
||||
inputs[| 1] = nodeValue("Padding", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [0, 0, 0, 0])
|
||||
.setDisplay(VALUE_DISPLAY.padding)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_create_Json_File_Read(_x, _y, _group = noone) {
|
||||
var path = "";
|
||||
if(!LOADING && !APPENDING && !CLONING) {
|
||||
path = get_open_filename(".json", "");
|
||||
path = get_open_filename("JSON file|*.json", "");
|
||||
key_release();
|
||||
if(path == "") return noone;
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ function Node_Json_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) cons
|
|||
|
||||
|
||||
inputs[| 0] = nodeValue("Path", self, JUNCTION_CONNECT.input, VALUE_TYPE.path, "")
|
||||
.setDisplay(VALUE_DISPLAY.path_load, { filter: "*.json" })
|
||||
.setDisplay(VALUE_DISPLAY.path_load, { filter: "JSON file|*.json" })
|
||||
.rejectArray();
|
||||
|
||||
outputs[| 0] = nodeValue("Path", self, JUNCTION_CONNECT.output, VALUE_TYPE.path, "")
|
||||
|
|
|
@ -5,7 +5,7 @@ function Node_Json_File_Write(_x, _y, _group = noone) : Node(_x, _y, _group) con
|
|||
w = 128;
|
||||
|
||||
inputs[| 0] = nodeValue("Path", self, JUNCTION_CONNECT.input, VALUE_TYPE.path, "")
|
||||
.setDisplay(VALUE_DISPLAY.path_save, { filter: "*.json" })
|
||||
.setDisplay(VALUE_DISPLAY.path_save, { filter: "json file|*.json" })
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 1] = nodeValue("Struct", self, JUNCTION_CONNECT.input, VALUE_TYPE.struct, {})
|
||||
|
|
|
@ -823,9 +823,9 @@ function __initNodes() {
|
|||
addNodeObject(node, "Lua Global", s_node_lua_global, "Node_Lua_Global", [1, Node_Lua_Global]).setVersion(1090);
|
||||
addNodeObject(node, "Lua Surface", s_node_lua_surface, "Node_Lua_Surface", [1, Node_Lua_Surface]).setVersion(1090);
|
||||
addNodeObject(node, "Lua Compute", s_node_lua_compute, "Node_Lua_Compute", [1, Node_Lua_Compute]).setVersion(1090);
|
||||
|
||||
|
||||
ds_list_add(node, "Shader");
|
||||
addNodeObject(node, "HLSL", s_node_hlsl, "Node_HLSL", [1, Node_HLSL],, "Execute HLSL shader on a surface.").setVersion(11520);
|
||||
if(OS == os_windows) addNodeObject(node, "HLSL", s_node_hlsl, "Node_HLSL", [1, Node_HLSL],, "Execute HLSL shader on a surface.").setVersion(11520);
|
||||
|
||||
ds_list_add(node, "Organize");
|
||||
addNodeObject(node, "Pin", s_node_pin, "Node_Pin", [1, Node_Pin],, "Craete pin to organize your connection. Can be create by double clicking on a connection line.");
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_create_Text_File_Read(_x, _y, _group = noone) {
|
||||
var path = "";
|
||||
if(!LOADING && !APPENDING && !CLONING) {
|
||||
path = get_open_filename(".txt", "");
|
||||
path = get_open_filename("text file|*.txt", "");
|
||||
key_release();
|
||||
if(path == "") return noone;
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ function Node_Text_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) cons
|
|||
w = 128;
|
||||
|
||||
inputs[| 0] = nodeValue("Path", self, JUNCTION_CONNECT.input, VALUE_TYPE.path, "")
|
||||
.setDisplay(VALUE_DISPLAY.path_load, { filter: "*.txt" })
|
||||
.setDisplay(VALUE_DISPLAY.path_load, { filter: "text file|*.txt" })
|
||||
.rejectArray();
|
||||
|
||||
outputs[| 0] = nodeValue("Content", self, JUNCTION_CONNECT.output, VALUE_TYPE.text, "");
|
||||
|
|
|
@ -5,7 +5,7 @@ function Node_Text_File_Write(_x, _y, _group = noone) : Node(_x, _y, _group) con
|
|||
w = 128;
|
||||
|
||||
inputs[| 0] = nodeValue("Path", self, JUNCTION_CONNECT.input, VALUE_TYPE.path, "")
|
||||
.setDisplay(VALUE_DISPLAY.path_save, { filter: "*.txt" })
|
||||
.setDisplay(VALUE_DISPLAY.path_save, { filter: "text file|*.txt" })
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 1] = nodeValue("Content", self, JUNCTION_CONNECT.input, VALUE_TYPE.text, "")
|
||||
|
|
|
@ -504,11 +504,12 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
static DISPLAY_DATA_KEYS = [ "linked", "angle_display", "bone_id", "area_type", "unit", "atlas_crop" ];
|
||||
|
||||
#region ---- main ----
|
||||
node = _node;
|
||||
x = node.x;
|
||||
y = node.y;
|
||||
index = _connect == JUNCTION_CONNECT.input? ds_list_size(node.inputs) : ds_list_size(node.outputs);
|
||||
type = _type;
|
||||
active = true;
|
||||
node = _node;
|
||||
x = node.x;
|
||||
y = node.y;
|
||||
index = _connect == JUNCTION_CONNECT.input? ds_list_size(node.inputs) : ds_list_size(node.outputs);
|
||||
type = _type;
|
||||
forward = true;
|
||||
_initName = _name;
|
||||
|
||||
|
@ -535,6 +536,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
|
||||
tooltip = _tooltip;
|
||||
editWidget = noone;
|
||||
active_tooltip = "";
|
||||
|
||||
tags = VALUE_TAG.none;
|
||||
#endregion
|
||||
|
@ -702,6 +704,21 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
return self;
|
||||
} #endregion
|
||||
|
||||
static setActive = function(_active, _tooltip) { #region
|
||||
INLINE
|
||||
active = _active;
|
||||
active_tooltip = _tooltip;
|
||||
|
||||
return self;
|
||||
} #endregion
|
||||
|
||||
static setWindows = function() { #region
|
||||
INLINE
|
||||
setActive(OS == os_windows, "Not available on MacOS");
|
||||
|
||||
return self;
|
||||
} #endregion
|
||||
|
||||
static resetValue = function() { #region
|
||||
unit.mode = def_unit;
|
||||
setValue(unit.apply(def_val));
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function Node_create_WAV_File_Read(_x, _y, _group = noone) { #region
|
||||
var path = "";
|
||||
if(!LOADING && !APPENDING && !CLONING) {
|
||||
path = get_open_filename(".wav", "");
|
||||
path = get_open_filename("audio|*.wav", "");
|
||||
key_release();
|
||||
if(path == "") return noone;
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ function Node_WAV_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
|||
min_h = h;
|
||||
|
||||
inputs[| 0] = nodeValue("Path", self, JUNCTION_CONNECT.input, VALUE_TYPE.path, "")
|
||||
.setDisplay(VALUE_DISPLAY.path_load, { filter: "*.wav" })
|
||||
.setDisplay(VALUE_DISPLAY.path_load, { filter: "audio|*.wav" })
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 1] = nodeValue("Sync lenght", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
|
|
|
@ -6,7 +6,7 @@ function Node_WAV_File_Write(_x, _y, _group = noone) : Node(_x, _y, _group) cons
|
|||
min_h = h;
|
||||
|
||||
inputs[| 0] = nodeValue("Path", self, JUNCTION_CONNECT.input, VALUE_TYPE.path, "")
|
||||
.setDisplay(VALUE_DISPLAY.path_save, { filter: "*.wav" })
|
||||
.setDisplay(VALUE_DISPLAY.path_save, { filter: "audio file|*.wav" })
|
||||
.rejectArray()
|
||||
.setVisible(true);
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ function Node_Widget_Test(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
|||
inputs[| 21] = nodeValue("buttonPalette", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, DEF_PALETTE) .setDisplay(VALUE_DISPLAY.palette)
|
||||
inputs[| 22] = nodeValue("buttonGradient", self, JUNCTION_CONNECT.input, VALUE_TYPE.gradient, new gradientObject(c_white)) .setDisplay(VALUE_DISPLAY._default)
|
||||
|
||||
inputs[| 23] = nodeValue("pathArrayBox", self, JUNCTION_CONNECT.input, VALUE_TYPE.path, []) .setDisplay(VALUE_DISPLAY.path_array, { filter: [ "*.png", "" ] })
|
||||
inputs[| 23] = nodeValue("pathArrayBox", self, JUNCTION_CONNECT.input, VALUE_TYPE.path, []) .setDisplay(VALUE_DISPLAY.path_array, { filter: [ "image|*.png;*.jpg", "" ] })
|
||||
inputs[| 24] = nodeValue("pathLoad", self, JUNCTION_CONNECT.input, VALUE_TYPE.path, "") .setDisplay(VALUE_DISPLAY.path_load)
|
||||
inputs[| 25] = nodeValue("pathSave", self, JUNCTION_CONNECT.input, VALUE_TYPE.path, "") .setDisplay(VALUE_DISPLAY.path_save)
|
||||
inputs[| 26] = nodeValue("fontScrollBox", self, JUNCTION_CONNECT.input, VALUE_TYPE.path, "") .setDisplay(VALUE_DISPLAY.path_font)
|
||||
|
|
|
@ -53,7 +53,7 @@ function Panel_Graph_Export_Image(targetPanel) : PanelContent() constructor {
|
|||
b_export = button(function() { #region
|
||||
if(!is_surface(surface)) return;
|
||||
|
||||
var path = get_save_filename("*.png", "Screenshot");
|
||||
var path = get_save_filename("image|*.png;*.jpg", "Screenshot");
|
||||
if(path == -1) return;
|
||||
|
||||
if(filename_ext(path) != ".png") path += ".png";
|
||||
|
|
|
@ -835,11 +835,12 @@ function Panel_Preview() : PanelContent() constructor {
|
|||
|
||||
d3_view_camera.applyCamera();
|
||||
|
||||
gpu_set_ztestenable(true);
|
||||
gpu_set_zwriteenable(false);
|
||||
|
||||
if(OS != os_macosx) {
|
||||
gpu_set_cullmode(cull_noculling);
|
||||
gpu_set_ztestenable(true);
|
||||
gpu_set_zwriteenable(false);
|
||||
|
||||
|
||||
shader_set(sh_d3d_grid_view);
|
||||
var _dist = round(d3_view_camera.focus.distance(d3_view_camera.position));
|
||||
var _tx = round(d3_view_camera.focus.x);
|
||||
|
@ -853,9 +854,9 @@ function Panel_Preview() : PanelContent() constructor {
|
|||
shader_set_f("shift", _tx / _dist / 2, _ty / _dist / 2);
|
||||
draw_sprite_stretched(s_fx_pixel, 0, _tx - _dist, _ty - _dist, _dist * 2, _dist * 2);
|
||||
shader_reset();
|
||||
|
||||
gpu_set_zwriteenable(true);
|
||||
}
|
||||
|
||||
gpu_set_zwriteenable(true);
|
||||
#endregion
|
||||
|
||||
#region draw
|
||||
|
@ -1477,7 +1478,7 @@ function Panel_Preview() : PanelContent() constructor {
|
|||
var prevS = getNodePreviewSurface();
|
||||
if(!is_surface(prevS)) return;
|
||||
|
||||
var path = get_save_filename(".png", "export");
|
||||
var path = get_save_filename("image|*.png;*.jpg", "export");
|
||||
key_release();
|
||||
if(path == "") return;
|
||||
if(filename_ext(path) != ".png") path += ".png";
|
||||
|
@ -1486,7 +1487,7 @@ function Panel_Preview() : PanelContent() constructor {
|
|||
} #endregion
|
||||
|
||||
function saveAllCurrentFrames() { #region
|
||||
var path = get_save_filename(".png", "export");
|
||||
var path = get_save_filename("image|*.png;*.jpg", "export");
|
||||
key_release();
|
||||
if(path == "") return;
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
#region parser
|
||||
function functionStringClean(fx) { #region
|
||||
static __BRACKETS = [ "(", "[" ];
|
||||
static __BRACKETS = [ "(", "[", "," ];
|
||||
|
||||
var ch = "", ind = 0, len = string_length(fx);
|
||||
var _fx = "", str = false;
|
||||
|
|
|
@ -170,8 +170,9 @@ function winManStep() { #region
|
|||
|
||||
winMan_setRect(sx, sy, sw, sh);
|
||||
|
||||
if(mouse_release(mb_left))
|
||||
if(mouse_release(mb_left)) {
|
||||
DISPLAY_REFRESH
|
||||
}
|
||||
}
|
||||
|
||||
if(mouse_release(mb_left)) {
|
||||
|
|
|
@ -76,6 +76,18 @@ uniform int use_8bit;
|
|||
uniform mat4 viewProjMat;
|
||||
#endregion
|
||||
|
||||
#region ++++ mapping ++++
|
||||
vec2 equirectangularUv(vec3 dir) {
|
||||
vec3 n = normalize(dir);
|
||||
return vec2((atan(n.x, n.y) / TAU) + 0.5, 1. - acos(n.z) / PI);
|
||||
}
|
||||
|
||||
float unormToFloat(vec3 v) {
|
||||
v *= 256.;
|
||||
return (v.r * 65536. + v.g * 256. + v.b) / (65536.);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ++++ matrix ++++
|
||||
float matrixGet(mat4 matrix, int index) {
|
||||
if(index < 0 || index > 15) return 0.;
|
||||
|
@ -97,25 +109,33 @@ uniform int use_8bit;
|
|||
|
||||
#region ++++ shadow sampler ++++
|
||||
float sampleDirShadowMap(int index, vec2 position) {
|
||||
if(index == 0) return texture2D(light_dir_shadowmap_0, position).r;
|
||||
if(index == 1) return texture2D(light_dir_shadowmap_1, position).r;
|
||||
//if(index == 2) return texture2D(light_dir_shadowmap_2, position).r;
|
||||
//if(index == 3) return texture2D(light_dir_shadowmap_3, position).r;
|
||||
return 0.;
|
||||
vec4 d;
|
||||
|
||||
if(index == 0) d = texture2D(light_dir_shadowmap_0, position);
|
||||
else if(index == 1) d = texture2D(light_dir_shadowmap_1, position);
|
||||
//else if(index == 2) d = texture2D(light_dir_shadowmap_2, position);
|
||||
//else if(index == 3) d = texture2D(light_dir_shadowmap_3, position);
|
||||
|
||||
if(use_8bit == 1)
|
||||
return unormToFloat(d.rgb);
|
||||
return d.r;
|
||||
}
|
||||
|
||||
float samplePntShadowMap(int index, vec2 position, int side) {
|
||||
float d = 0.;
|
||||
|
||||
position.x /= 2.;
|
||||
if(side >= 3) {
|
||||
position.x += 0.5;
|
||||
side -= 3;
|
||||
}
|
||||
|
||||
if(index == 0) return texture2D(light_pnt_shadowmap_0, position)[side];
|
||||
if(index == 1) return texture2D(light_pnt_shadowmap_1, position)[side];
|
||||
//if(index == 2) return texture2D(light_pnt_shadowmap_2, position)[side];
|
||||
//if(index == 3) return texture2D(light_pnt_shadowmap_3, position)[side];
|
||||
return 0.;
|
||||
if(index == 0) d = texture2D(light_pnt_shadowmap_0, position)[side];
|
||||
else if(index == 1) d = texture2D(light_pnt_shadowmap_1, position)[side];
|
||||
//else if(index == 2) d = texture2D(light_pnt_shadowmap_2, position)[side];
|
||||
//else if(index == 3) d = texture2D(light_pnt_shadowmap_3, position)[side];
|
||||
|
||||
return d;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
@ -142,17 +162,6 @@ uniform int use_8bit;
|
|||
}
|
||||
#endregion
|
||||
|
||||
#region ++++ mapping ++++
|
||||
vec2 equirectangularUv(vec3 dir) {
|
||||
vec3 n = normalize(dir);
|
||||
return vec2((atan(n.x, n.y) / TAU) + 0.5, 1. - acos(n.z) / PI);
|
||||
}
|
||||
|
||||
vec4 unormToFloat(vec4 vec) {
|
||||
return vec - 1. * 65536.;
|
||||
}
|
||||
#endregion
|
||||
|
||||
void main() {
|
||||
vec2 uv_coord = v_vTexcoord;
|
||||
if(mat_flip == 1) uv_coord.y = -uv_coord.y;
|
||||
|
@ -170,11 +179,8 @@ void main() {
|
|||
#region ++++ normal ++++
|
||||
vec3 _norm = v_vNormal;
|
||||
|
||||
if(mat_defer_normal == 1) {
|
||||
if(mat_defer_normal == 1)
|
||||
_norm = texture2D(mat_normal_map, viewProjPos.xy).rgb;
|
||||
if(use_8bit == 1)
|
||||
_norm = unormToFloat(_norm);
|
||||
}
|
||||
|
||||
vec3 normal = normalize(_norm);
|
||||
#endregion
|
||||
|
@ -232,12 +238,15 @@ void main() {
|
|||
|
||||
if(lightMapPosition.x >= 0. && lightMapPosition.x <= 1. && lightMapPosition.y >= 0. && lightMapPosition.y <= 1.) {
|
||||
light_map_depth = sampleDirShadowMap(shadow_map_index, lightMapPosition);
|
||||
|
||||
|
||||
//gl_FragData[0] = texture2D(light_dir_shadowmap_0, lightMapPosition);
|
||||
//return;
|
||||
|
||||
shadow_map_index++;
|
||||
lightDistance = v_lightDistance;
|
||||
float shadowFactor = dot(normal, lightVector);
|
||||
float bias = mix(light_dir_shadow_bias[i], 0., shadowFactor);
|
||||
|
||||
|
||||
if(lightDistance > light_map_depth + bias)
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -21,10 +21,4 @@ void main() {
|
|||
gl_FragData[0] = vec4(v_worldPosition.xyz, mat_baseColor.a);
|
||||
gl_FragData[1] = vec4(v_viewPosition, mat_baseColor.a);
|
||||
gl_FragData[2] = vec4(normalize(normal), mat_baseColor.a);
|
||||
|
||||
if(use_8bit == 1) {
|
||||
gl_FragData[0] = gl_FragData[0] / 65536. + 1.;
|
||||
gl_FragData[1] = gl_FragData[1] / 65536. + 1.;
|
||||
gl_FragData[2] = gl_FragData[2] / 65536. + 1.;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ varying vec4 v_vColour;
|
|||
uniform vec2 dimension;
|
||||
uniform float radius;
|
||||
uniform int use_8bit;
|
||||
|
||||
|
||||
void main() {
|
||||
vec3 current = texture2D( gm_BaseTexture, v_vTexcoord ).rgb;
|
||||
if(length(current) == 0.) {
|
||||
|
@ -39,6 +39,6 @@ void main() {
|
|||
gl_FragColor = vec4(sampled / weight, 1.);
|
||||
|
||||
if(use_8bit == 1) {
|
||||
gl_FragColor = gl_FragColor / 65536. + 1.;
|
||||
gl_FragColor = gl_FragColor / 256.;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,19 @@
|
|||
varying float v_LightDepth;
|
||||
uniform int use_8bit;
|
||||
|
||||
void main() {
|
||||
gl_FragColor = vec4(v_LightDepth, v_LightDepth, v_LightDepth, 1.);
|
||||
//gl_FragColor = vec4(1.);
|
||||
vec3 floatToUnorm(float v) {
|
||||
v *= 65536.;
|
||||
|
||||
float r = floor(v / 65536.); v -= 65536. * r;
|
||||
float g = floor(v / 256.); v -= 256. * g;
|
||||
float b = floor(v);
|
||||
|
||||
return vec3(r, g, b) / 256.;
|
||||
}
|
||||
|
||||
void main() {
|
||||
float d = v_LightDepth;
|
||||
|
||||
if(use_8bit == 1) gl_FragColor = vec4(floatToUnorm(d), 1.);
|
||||
else gl_FragColor = vec4(vec3(d), 1.);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue