This commit is contained in:
luboslenco
2025-01-02 16:32:43 +01:00
parent ee0fba2de5
commit be43bc1040
26 changed files with 91 additions and 78 deletions
+9 -9
View File
@@ -457,20 +457,20 @@ vec4_t mat4_get_scale(mat4_t m) {
mat4_t mat4_mult(mat4_t m, float s) {
m.m[0] *= s;
m.m[4] *= s;
m.m[8] *= s;
m.m[12] *= s;
m.m[1] *= s;
m.m[5] *= s;
m.m[9] *= s;
m.m[13] *= s;
m.m[2] *= s;
m.m[6] *= s;
m.m[10] *= s;
m.m[14] *= s;
m.m[3] *= s;
m.m[4] *= s;
m.m[5] *= s;
m.m[6] *= s;
m.m[7] *= s;
m.m[8] *= s;
m.m[9] *= s;
m.m[10] *= s;
m.m[11] *= s;
m.m[12] *= s;
m.m[13] *= s;
m.m[14] *= s;
m.m[15] *= s;
return m;
}
+1 -1
View File
@@ -54,7 +54,7 @@ function make_material_parse_mesh_material() {
///if arm_voxels
function make_material_make_voxel(m: material_data_t) {
let rebuild: bool = true; // heightUsed;
let rebuild: bool = true; // height_used;
if (config_raw.rp_gi != false && rebuild) {
let scon: shader_context_t = null;
for (let i: i32 = 0; i < m._.shader._.contexts.length; ++i) {
+26 -26
View File
@@ -100,33 +100,33 @@ function render_path_paint_commands_paint(dilation: bool = true) {
// Picked surface values
// ///if (arm_metal || arm_vulkan)
// context_raw.pickedColor.base.Rb = a.get(2);
// context_raw.pickedColor.base.Gb = a.get(1);
// context_raw.pickedColor.base.Bb = a.get(0);
// context_raw.pickedColor.normal.Rb = b.get(2);
// context_raw.pickedColor.normal.Gb = b.get(1);
// context_raw.pickedColor.normal.Bb = b.get(0);
// context_raw.pickedColor.occlusion = c.get(2) / 255;
// context_raw.pickedColor.roughness = c.get(1) / 255;
// context_raw.pickedColor.metallic = c.get(0) / 255;
// context_raw.pickedColor.height = c.get(3) / 255;
// context_raw.pickedColor.opacity = a.get(3) / 255;
// context_raw.uvxPicked = d.get(2) / 255;
// context_raw.uvyPicked = d.get(1) / 255;
// context_raw.picked_color.base.Rb = a.get(2);
// context_raw.picked_color.base.Gb = a.get(1);
// context_raw.picked_color.base.Bb = a.get(0);
// context_raw.picked_color.normal.Rb = b.get(2);
// context_raw.picked_color.normal.Gb = b.get(1);
// context_raw.picked_color.normal.Bb = b.get(0);
// context_raw.picked_color.occlusion = c.get(2) / 255;
// context_raw.picked_color.roughness = c.get(1) / 255;
// context_raw.picked_color.metallic = c.get(0) / 255;
// context_raw.picked_color.height = c.get(3) / 255;
// context_raw.picked_color.opacity = a.get(3) / 255;
// context_raw.uvx_picked = d.get(2) / 255;
// context_raw.uvy_picked = d.get(1) / 255;
// ///else
// context_raw.pickedColor.base.Rb = a.get(0);
// context_raw.pickedColor.base.Gb = a.get(1);
// context_raw.pickedColor.base.Bb = a.get(2);
// context_raw.pickedColor.normal.Rb = b.get(0);
// context_raw.pickedColor.normal.Gb = b.get(1);
// context_raw.pickedColor.normal.Bb = b.get(2);
// context_raw.pickedColor.occlusion = c.get(0) / 255;
// context_raw.pickedColor.roughness = c.get(1) / 255;
// context_raw.pickedColor.metallic = c.get(2) / 255;
// context_raw.pickedColor.height = c.get(3) / 255;
// context_raw.pickedColor.opacity = a.get(3) / 255;
// context_raw.uvxPicked = d.get(0) / 255;
// context_raw.uvyPicked = d.get(1) / 255;
// context_raw.picked_color.base.Rb = a.get(0);
// context_raw.picked_color.base.Gb = a.get(1);
// context_raw.picked_color.base.Bb = a.get(2);
// context_raw.picked_color.normal.Rb = b.get(0);
// context_raw.picked_color.normal.Gb = b.get(1);
// context_raw.picked_color.normal.Bb = b.get(2);
// context_raw.picked_color.occlusion = c.get(0) / 255;
// context_raw.picked_color.roughness = c.get(1) / 255;
// context_raw.picked_color.metallic = c.get(2) / 255;
// context_raw.picked_color.height = c.get(3) / 255;
// context_raw.picked_color.opacity = a.get(3) / 255;
// context_raw.uvx_picked = d.get(0) / 255;
// context_raw.uvy_picked = d.get(1) / 255;
// ///end
}
else {
+1 -1
View File
@@ -224,7 +224,7 @@ function make_mesh_run(data: material_t, layer_pass: i32 = 0): node_shader_conte
node_shader_write(frag, "texpaint_sample = textureLodShared(texpaint" + l.id + ", tex_coord, 0.0);");
node_shader_write(frag, "texpaint_opac = texpaint_sample.a;");
// ///if (arm_direct3d12 || arm_vulkan)
// if (raw.viewportMode == ViewLit) {
// if (raw.viewport_mode == viewport_mode_t.LIT) {
// write(frag, "if (texpaint_opac < 0.1) discard;");
// }
// ///end
+1 -1
View File
@@ -95,7 +95,7 @@ function make_mesh_preview_run(data: material_t, matcon: material_context_t): no
// node_shader_add_out(vert, "float height");
// node_shader_write(vert, "height = vheight;");
// let displace_strength = 0.1;
// if (heightUsed && displace_strength > 0.0) {
// if (height_used && displace_strength > 0.0) {
// node_shader_write(vert, "vec3 pos2 = " + pos + ".xyz + vec3(nor.xy, pos.w) * vec3(" + height + ", " + height + ", " + height + ") * vec3(" + displace_strength + ", " + displace_strength + ", " + displace_strength + ");");
// node_shader_write(vert, "gl_Position = mul(vec4(pos2.xyz, 1.0), WVP);");
// }
+2 -2
View File
@@ -288,7 +288,7 @@ function tab_layers_draw_layer_slot_full(l: slot_layer_t, i: i32) {
// if (in_focus && ui.is_delete_down && can_delete(context_raw.layer)) {
// ui.is_delete_down = false;
// let _init() = function () {
// deleteLayer(context_raw.layer);
// delete_layer(context_raw.layer);
// }
// app_notify_on_init(_init);
// }
@@ -310,7 +310,7 @@ function tab_layers_draw_layer_slot_full(l: slot_layer_t, i: i32) {
ui._y += center;
}
// comboBlending(ui, l);
// combo_blending(ui, l);
_ui_end_element();
if (slot_layer_is_mask(l)) {
-1
View File
@@ -527,7 +527,6 @@
"Split View": "Geteilte Ansicht",
"Square Root": "Quadratwurzel",
"Stencil": "Schablone",
"Stength": "Stärke",
"Stop": "Stoppen",
"Straight": "Gerade",
"Strength": "Stärke",
-1
View File
@@ -450,7 +450,6 @@
"Split View": "Διαίρεση Προβολής",
"Square Root": "Τετραγωνική Ρίζα",
"Stencil": "Στένσιλ",
"Stength": "Ισχύς",
"Stop": "Τερματισμός",
"Straight": "Ευθύ",
"Strength": "Iσχύς",
-1
View File
@@ -526,7 +526,6 @@
"Split View": "ビューを分割",
"Square Root": "平方根",
"Stencil": "ステンシル",
"Stength": "強さ",
"Stop": "停止",
"Straight": "直線",
"Strength": "強さ",
+2 -2
View File
@@ -689,8 +689,8 @@ function box_preferences_show() {
context_raw.ddirty = 2;
}
// let h: ui_handle_t = ui_handle("boxpreferences_46", { value: raw.autoExposureStrength });
// raw.autoExposureStrength = ui_slider(h, "Auto Exposure", 0.0, 2.0, true);
// let h: ui_handle_t = ui_handle("boxpreferences_46", { value: raw.auto_exposure_strength });
// raw.auto_exposure_strength = ui_slider(h, "Auto Exposure", 0.0, 2.0, true);
// if (h.changed) raw.ddirty = 2;
let cam: camera_object_t = scene_camera;
+1 -1
View File
@@ -206,7 +206,7 @@ function export_arm_run_project() {
// raw.mesh_icons =
// ///if (arm_metal || arm_vulkan)
// [encode(bgraSwap(mesh_icon_pixels)];
// [encode(bgra_swap(mesh_icon_pixels)];
// ///else
// [encode(mesh_icon_pixels)];
// ///end
+1 -1
View File
@@ -88,7 +88,7 @@ function export_obj_run(path: string, paint_objects: mesh_object_t[], apply_disp
}
if (apply_disp) {
// let height: buffer_t = layers[0].texpaint_pack.getPixels();
// let height: buffer_t = image_get_pixels(layers[0].texpaint_pack);
// let res: i32 = layers[0].texpaint_pack.width;
// let strength: f32 = 0.1;
// for (let i: i32 = 0; i < len; ++i) {
+2 -2
View File
@@ -85,8 +85,8 @@ function file_create_directory(path: string) {
iron_sys_command(file_cmd_mkdir + " \"" + path + "\"");
}
function file_copy(srcPath: string, dst_path: string) {
iron_sys_command(file_cmd_copy + " \"" + srcPath + "\" \"" + dst_path + "\"");
function file_copy(src_path: string, dst_path: string) {
iron_sys_command(file_cmd_copy + " \"" + src_path + "\" \"" + dst_path + "\"");
}
function file_start(path: string) {
+2 -2
View File
@@ -49,7 +49,7 @@ function geom_make_plane(size_x: f32 = 1.0, size_y: f32 = 1.0, verts_x: i32 = 2,
return mesh;
}
function geom_make_uv_sphere(radius: f32 = 1.0, width_segments: i32 = 32, height_segments: i32 = 16, stretch_uv: bool = true, uvScale: f32 = 1.0): raw_mesh_t {
function geom_make_uv_sphere(radius: f32 = 1.0, width_segments: i32 = 32, height_segments: i32 = 16, stretch_uv: bool = true, uv_scale: f32 = 1.0): raw_mesh_t {
let mesh: raw_mesh_t = {};
mesh.scale_pos = 1.0;
@@ -59,7 +59,7 @@ function geom_make_uv_sphere(radius: f32 = 1.0, width_segments: i32 = 32, height
// Pack positions to (-1, 1) range
mesh.scale_pos = radius;
mesh.scale_tex = uvScale;
mesh.scale_tex = uv_scale;
let inv: f32 = (1 / mesh.scale_pos) * 32767;
let pi2: f32 = math_pi() * 2;
+2 -2
View File
@@ -490,9 +490,9 @@ function history_clear_layer() {
history_push(tr("Clear Layer"));
}
function history_order_layers(prevOrder: i32) {
function history_order_layers(prev_order: i32) {
let step: step_t = history_push(tr("Order Layers"));
step.prev_order = prevOrder;
step.prev_order = prev_order;
}
function history_merge_layers() {
+1 -1
View File
@@ -170,7 +170,7 @@ function _import_mesh_make_mesh(mesh: raw_mesh_t) {
}
///end
// Wait for addMesh calls to finish
// Wait for add_mesh calls to finish
if (import_mesh_meshes_to_unwrap != null) {
app_notify_on_next_frame(import_mesh_finish_import);
}
+1 -1
View File
@@ -725,7 +725,7 @@ function layers_merge_layer(l0 : slot_layer_t, l1: slot_layer_t, use_mask: bool
let l1masks: slot_layer_t[] = use_mask ? slot_layer_get_masks(l1) : null;
if (l1masks != null) {
// for (let i: i32 = 1; i < l1masks.length - 1; ++i) {
// mergeLayer(l1masks[i + 1], l1masks[i]);
// merge_layer(l1masks[i + 1], l1masks[i]);
// }
mask = l1masks[0].texpaint;
}
+2 -2
View File
@@ -2445,7 +2445,7 @@ let nodes_material_color: ui_node_t[] = [
{
id: 0,
node_id: 0,
name: _tr("Stength"),
name: _tr("Strength"),
type: "VALUE",
color: 0xffa1a1a1,
default_value: f32_array_create_x(0.1),
@@ -2901,7 +2901,7 @@ let nodes_material_vector: ui_node_t[] = [
{
id: 0,
node_id: 0,
name: _tr("Stength"),
name: _tr("Strength"),
type: "VALUE",
color: 0xffa1a1a1,
default_value: f32_array_create_x(1.0),
+7 -7
View File
@@ -735,12 +735,12 @@ function parser_material_parse_vector(node: ui_node_t, socket: ui_node_socket_t)
return "(floor(100.0 * " + strength + " * " + col + ") / (100.0 * " + strength + "))";
}
else if (node.type == "REPLACECOL") {
let inputColor: string = parser_material_parse_vector_input(node.inputs[0]);
let oldColor: string = parser_material_parse_vector_input(node.inputs[1]);
let newColor: string = parser_material_parse_vector_input(node.inputs[2]);
let input_color: string = parser_material_parse_vector_input(node.inputs[0]);
let old_color: string = parser_material_parse_vector_input(node.inputs[1]);
let new_color: string = parser_material_parse_vector_input(node.inputs[2]);
let radius: string = parser_material_parse_value_input(node.inputs[3]);
let fuzziness: string = parser_material_parse_value_input(node.inputs[4]);
return "mix(" + newColor + ", " + inputColor + ", clamp((distance(" + oldColor + ", " + inputColor + ") - " + radius + ") / max(" + fuzziness + ", " + parser_material_eps + "), 0.0, 1.0))";
return "mix(" + new_color + ", " + input_color + ", clamp((distance(" + old_color + ", " + input_color + ") - " + radius + ") / max(" + fuzziness + ", " + parser_material_eps + "), 0.0, 1.0))";
}
else if (node.type == "VALTORGB") { // ColorRamp
let fac: string = parser_material_parse_value_input(node.inputs[0]);
@@ -1486,11 +1486,11 @@ function parser_material_parse_value(node: ui_node_t, socket: ui_node_socket_t):
return "dot(" + norout + ", " + nor + ")";
}
else if (node.type == "COLMASK") {
let inputColor: string = parser_material_parse_vector_input(node.inputs[0]);
let maskColor: string = parser_material_parse_vector_input(node.inputs[1]);
let input_color: string = parser_material_parse_vector_input(node.inputs[0]);
let mask_color: string = parser_material_parse_vector_input(node.inputs[1]);
let radius: string = parser_material_parse_value_input(node.inputs[2]);
let fuzziness: string = parser_material_parse_value_input(node.inputs[3]);
return "clamp(1.0 - (distance(" + inputColor + ", " + maskColor + ") - " + radius + ") / max(" + fuzziness + ", " + parser_material_eps + "), 0.0, 1.0)";
return "clamp(1.0 - (distance(" + input_color + ", " + mask_color + ") - " + radius + ") / max(" + fuzziness + ", " + parser_material_eps + "), 0.0, 1.0)";
}
else if (node.type == "MATH") {
let val1: string = parser_material_parse_value_input(node.inputs[0]);
+17
View File
@@ -189,6 +189,23 @@ function render_path_raytrace_build_data() {
///end
render_path_raytrace_transform = mo.base.transform.world_unpack;
let md: mesh_data_t = mo.data;
if (md.scale_pos != 1.0) {
render_path_raytrace_transform = mat4_scale(
render_path_raytrace_transform, vec4_create(md.scale_pos, md.scale_pos, md.scale_pos)
);
}
if (mo.base.parent != null) {
let f: f32 = mo.base.parent.transform.scale.x;
if (f != 1.0) {
render_path_raytrace_transform = mat4_scale(
render_path_raytrace_transform, vec4_create(f, f, f)
);
}
}
render_path_raytrace_vb = mo.data._.vertex_buffer;
render_path_raytrace_ib = mo.data._.index_buffers[0];
}
+1 -1
View File
@@ -83,7 +83,7 @@ function tab_fonts_draw(htab: ui_handle_t) {
// ///if arm_opengl
// g4_set_pipeline(pipe);
// ///end
// g4_set_int(channelLocation, 1);
// g4_set_int(channel_location, 1);
state = _ui_image(img);
// g2_set_pipeline(null);
}
+2 -2
View File
@@ -81,7 +81,7 @@ function tab_materials_draw_slots(mini: bool) {
continue;
}
let img: image_t = ui_SCALE(ui) > 1 ? project_materials[i].image : project_materials[i].image_icon;
let imgFull: image_t = project_materials[i].image;
let img_full: image_t = project_materials[i].image;
// Highligh selected
if (context_raw.material == project_materials[i]) {
@@ -263,7 +263,7 @@ function tab_materials_draw_slots(mini: bool) {
});
}
if (ui.is_hovered) {
_ui_tooltip_image(imgFull);
_ui_tooltip_image(img_full);
if (i < 9) {
let i1: i32 = i + 1;
ui_tooltip(project_materials[i].canvas.name + " - (" + map_get(config_keymap, "select_material") + " " + i1 + ")");
+1 -1
View File
@@ -233,7 +233,7 @@ function tab_swatches_draw(htab: ui_handle_t) {
ui_fill(28, -2, 2, 32, ui.ops.theme.HIGHLIGHT_COL);
}
// Currently there is no valid dragPosition so reset it
// Currently there is no valid drag_position so reset it
if (!drag_pos_set) {
tab_swatches_drag_pos = -1;
}
-1
View File
@@ -431,7 +431,6 @@ function ui_menu_render() {
if (ui_menu_button(ui, tr("Zoom Out"), map_get(config_keymap, "view_zoom_out"))) {
viewport_zoom(-0.2);
}
// menuSeparator(ui);
let cam: camera_object_t = scene_camera;
context_raw.fov_handle = ui_handle(__ID__);
+2 -2
View File
@@ -207,8 +207,8 @@ function ui_menubar_show_menu(ui: ui_t, category: i32) {
ui_menu_x = math_floor(ui._x - ui._w);
ui_menu_y = math_floor(ui_MENUBAR_H(ui));
if (config_raw.touch_ui) {
let menuW: i32 = math_floor(base_default_element_w * ui_SCALE(base_ui_menu) * 2.0);
ui_menu_x -= math_floor((menuW - ui._w) / 2) + math_floor(ui_header_h / 2);
let menu_w: i32 = math_floor(base_default_element_w * ui_SCALE(base_ui_menu) * 2.0);
ui_menu_x -= math_floor((menu_w - ui._w) / 2) + math_floor(ui_header_h / 2);
ui_menu_x += math_floor(2 * ui_SCALE(base_ui_menu));
ui_menu_y -= math_floor(2 * ui_SCALE(base_ui_menu));
ui_menu_keep_open = true;
+7 -7
View File
@@ -170,19 +170,19 @@ function util_render_make_text_preview() {
let font_size: i32 = 200;
let text_w: i32 = math_floor(g2_font_width(font, font_size, text));
let text_h: i32 = math_floor(g2_font_height(font, font_size));
let texW: i32 = text_w + 32;
if (texW < 512) {
texW = 512;
let tex_w: i32 = text_w + 32;
if (tex_w < 512) {
tex_w = 512;
}
if (context_raw.text_tool_image != null && context_raw.text_tool_image.width < texW) {
if (context_raw.text_tool_image != null && context_raw.text_tool_image.width < tex_w) {
image_unload(context_raw.text_tool_image);
context_raw.text_tool_image = null;
}
if (context_raw.text_tool_image == null) {
///if arm_metal
context_raw.text_tool_image = image_create_render_target(texW, texW, tex_format_t.RGBA32);
context_raw.text_tool_image = image_create_render_target(tex_w, tex_w, tex_format_t.RGBA32);
///else
context_raw.text_tool_image = image_create_render_target(texW, texW, tex_format_t.R8);
context_raw.text_tool_image = image_create_render_target(tex_w, tex_w, tex_format_t.R8);
///end
}
g2_begin(context_raw.text_tool_image);
@@ -190,7 +190,7 @@ function util_render_make_text_preview() {
g2_set_font(font);
g2_set_font_size(font_size);
g2_set_color(0xffffffff);
g2_draw_string(text, texW / 2 - text_w / 2, texW / 2 - text_h / 2);
g2_draw_string(text, tex_w / 2 - text_w / 2, tex_w / 2 - text_h / 2);
g2_end();
if (g2_in_use) g2_begin(current);