diff --git a/paint/sources/globals.h b/paint/sources/globals.h index b64eb837..c55474c0 100644 --- a/paint/sources/globals.h +++ b/paint/sources/globals.h @@ -48,7 +48,7 @@ gpu_pipeline_t *pipes_merge_r = NULL; gpu_pipeline_t *pipes_merge_g = NULL; gpu_pipeline_t *pipes_merge_b = NULL; gpu_pipeline_t *pipes_merge_mask; -gpu_pipeline_t *pipes_invert8; +gpu_pipeline_t *pipes_invert_mask; gpu_pipeline_t *pipes_apply_mask; gpu_pipeline_t *pipes_colorid_to_mask; i32 pipes_tex0; diff --git a/paint/sources/import_mesh.c b/paint/sources/import_mesh.c index 0882f3c8..bf891e25 100644 --- a/paint/sources/import_mesh.c +++ b/paint/sources/import_mesh.c @@ -103,6 +103,7 @@ void import_mesh_finish_import(void *_) { if (string_equals(g_context->paint_object->base->name, "")) { g_context->paint_object->base->name = "Object"; } + make_material_parse_paint_material(true); make_material_parse_mesh_material(); ui_view2d_hwnd->redraws = 2; diff --git a/paint/sources/pipes.c b/paint/sources/pipes.c index 469aa63c..8b68764e 100644 --- a/paint/sources/pipes.c +++ b/paint/sources/pipes.c @@ -116,18 +116,16 @@ void pipes_init() { { - pipes_invert8 = gpu_create_pipeline(); - gc_root(pipes_invert8); - pipes_invert8->vertex_shader = sys_get_shader("layer_invert.vert"); - pipes_invert8->fragment_shader = sys_get_shader("layer_invert.frag"); + pipes_invert_mask = gpu_create_pipeline(); + gc_root(pipes_invert_mask); + pipes_invert_mask->vertex_shader = sys_get_shader("layer_invert.vert"); + pipes_invert_mask->fragment_shader = sys_get_shader("layer_invert.frag"); gpu_vertex_structure_t *vs = GC_ALLOC_INIT(gpu_vertex_structure_t, {0}); gpu_vertex_structure_add(vs, "pos", GPU_VERTEX_DATA_F32_2X); gpu_vertex_structure_add(vs, "tex", GPU_VERTEX_DATA_F32_2X); gpu_vertex_structure_add(vs, "col", GPU_VERTEX_DATA_F32_4X); - pipes_invert8->input_layout = vs; - pipes_invert8->color_attachment_count = 1; - pipes_invert8->color_attachment[0] = GPU_TEXTURE_FORMAT_R8; - gpu_pipeline_compile(pipes_invert8); + pipes_invert_mask->input_layout = vs; + gpu_pipeline_compile(pipes_invert_mask); } { diff --git a/paint/sources/slot_layer.c b/paint/sources/slot_layer.c index 0ceed669..05696d59 100644 --- a/paint/sources/slot_layer.c +++ b/paint/sources/slot_layer.c @@ -242,7 +242,7 @@ void slot_layer_clear(slot_layer_t *raw, i32 base_color, gpu_texture_t *base_ima void slot_layer_invert_mask(slot_layer_t *raw) { gpu_texture_t *inverted = gpu_create_render_target(raw->texpaint->width, raw->texpaint->height, GPU_TEXTURE_FORMAT_RGBA32); draw_begin(inverted, false, 0); - draw_set_pipeline(pipes_invert8); + draw_set_pipeline(pipes_invert_mask); draw_image(raw->texpaint, 0, 0); draw_set_pipeline(NULL); draw_end();