diff --git a/armorpaint/sources/make_mesh.ts b/armorpaint/sources/make_mesh.ts index eaaf3cf9..81233137 100644 --- a/armorpaint/sources/make_mesh.ts +++ b/armorpaint/sources/make_mesh.ts @@ -93,7 +93,7 @@ function make_mesh_run(data: material_t, layer_pass: i32 = 0): node_shader_conte node_shader_add_texture(kong, "gbuffer0"); node_shader_add_texture(kong, "gbuffer1"); node_shader_add_texture(kong, "gbuffer2"); - node_shader_write_frag(kong, "var fragcoord: float2 = (input.wvpposition.x / input.wvpposition.w, input.wvpposition.y / input.wvpposition.w) * 0.5 + 0.5;"); + node_shader_write_frag(kong, "var fragcoord: float2 = float2(input.wvpposition.x / input.wvpposition.w, input.wvpposition.y / input.wvpposition.w) * 0.5 + 0.5;"); node_shader_write_frag(kong, "fragcoord.y = 1.0 - fragcoord.y;"); node_shader_write_frag(kong, "var gbuffer0_sample: float4 = sample_lod(gbuffer0, sampler_linear, fragcoord, 0.0);"); node_shader_write_frag(kong, "var gbuffer1_sample: float4 = sample_lod(gbuffer1, sampler_linear, fragcoord, 0.0);"); @@ -177,7 +177,7 @@ function make_mesh_run(data: material_t, layer_pass: i32 = 0): node_shader_conte count += masks.length; } texture_count += count; - if (texture_count >= make_mesh_get_max_textures()) { + if (texture_count >= GPU_MAX_TEXTURES - 3) { texture_count = start_count + count + 3; // gbuffer0_copy, gbuffer1_copy, gbuffer2_copy make_mesh_layer_pass_count++; } @@ -528,7 +528,3 @@ function make_mesh_run(data: material_t, layer_pass: i32 = 0): node_shader_conte return con_mesh; } - -function make_mesh_get_max_textures(): i32 { - return 16 - 3; // G4onG5/G4.c.h MAX_TEXTURES -} diff --git a/armorsculpt/sources/make_mesh.ts b/armorsculpt/sources/make_mesh.ts index 1ee73261..3564de8c 100644 --- a/armorsculpt/sources/make_mesh.ts +++ b/armorsculpt/sources/make_mesh.ts @@ -137,7 +137,7 @@ function make_mesh_run(data: material_t, layer_pass: i32 = 0): node_shader_conte count += masks.length; } texture_count += count; - if (texture_count >= make_mesh_get_max_textures()) { + if (texture_count >= GPU_MAX_TEXTURES - 3) { texture_count = start_count + count + 3; // gbuffer0_copy, gbuffer1_copy, gbuffer2_copy make_mesh_layer_pass_count++; } @@ -342,7 +342,3 @@ function make_mesh_run(data: material_t, layer_pass: i32 = 0): node_shader_conte gpu_create_shaders_from_kong(node_shader_get(kong), ADDRESS(con_mesh.data.vertex_shader), ADDRESS(con_mesh.data.fragment_shader), ADDRESS(con_mesh.data._.vertex_shader_size), ADDRESS(con_mesh.data._.fragment_shader_size)); return con_mesh; } - -function make_mesh_get_max_textures(): i32 { - return 16 - 3; // G4onG5/G4.c.h MAX_TEXTURES -} diff --git a/base/assets/shader_datas.arm b/base/assets/shader_datas.arm index a0c76a23..52840907 100644 Binary files a/base/assets/shader_datas.arm and b/base/assets/shader_datas.arm differ diff --git a/base/sources/ts/iron/iron.ts b/base/sources/ts/iron/iron.ts index fe6b6a25..db515ef4 100644 --- a/base/sources/ts/iron/iron.ts +++ b/base/sources/ts/iron/iron.ts @@ -280,7 +280,7 @@ declare function gpu_disable_scissor(): void; declare function _gpu_begin(render_target: gpu_texture_t, additional: gpu_texture_t[] = null, depth_buffer: gpu_texture_t = null, flags: i32 = clear_flag_t.NONE, color: i32 = 0, depth: f32 = 0.0): void; declare function gpu_end(): void; declare function gpu_present(): void; -declare function iron_file_save_bytes(path: string, bytes: buffer_t, length?: i32): void; +declare function iron_file_save_bytes(path: string, bytes: buffer_t, length: i32 = 0): void; declare function iron_sys_command(cmd: string): i32; declare function iron_internal_save_path(): string; declare function iron_get_arg_count(): i32; @@ -669,6 +669,7 @@ enum compare_mode_t { ALWAYS, NEVER, LESS, + EQUAL, } enum cull_mode_t { diff --git a/base/sources/ts/iron/shader_data.ts b/base/sources/ts/iron/shader_data.ts index 43ec3d39..a2a732b9 100644 --- a/base/sources/ts/iron/shader_data.ts +++ b/base/sources/ts/iron/shader_data.ts @@ -289,6 +289,9 @@ function shader_context_get_compare_mode(s: string): compare_mode_t { if (s == "never") { return compare_mode_t.NEVER; } + if (s == "equal") { + return compare_mode_t.EQUAL; + } return compare_mode_t.LESS; }