Skip to content

Commit

Permalink
Improve bake quality
Browse files Browse the repository at this point in the history
  • Loading branch information
luboslenco committed Jan 16, 2025
1 parent a82959a commit 7344cd4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
7 changes: 7 additions & 0 deletions armorpaint/sources/render_path_paint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -689,8 +689,15 @@ function render_path_paint_draw() {
}

if (context_raw.tool == workspace_tool_t.BAKE) {

if (context_raw.bake_type == bake_type_t.NORMAL || context_raw.bake_type == bake_type_t.HEIGHT || context_raw.bake_type == bake_type_t.DERIVATIVE) {
if (!render_path_paint_baking && context_raw.pdirty > 0) {

// Use RGBA128 texture format for high poly to low poly baking to prevent artifacts
// Existing undo layers are used during the baking process for now
base_bits_handle.position = texture_bits_t.BITS32;
layers_set_bits();

render_path_paint_baking = true;
_render_path_paint_bake_type = context_raw.bake_type;
context_raw.bake_type = context_raw.bake_type == bake_type_t.NORMAL ? bake_type_t.NORMAL_OBJECT : bake_type_t.POSITION; // Bake high poly data
Expand Down
1 change: 0 additions & 1 deletion base/sources/history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,6 @@ function history_apply_mask() {
history_push(tr("Apply Mask"));
}


function history_invert_mask() {
history_push(tr("Invert Mask"));
}
Expand Down
2 changes: 1 addition & 1 deletion base/sources/slot_layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ function slot_layer_resize_and_set_bits(raw: slot_layer_t) {
let format: tex_format_t =
base_bits_handle.position == texture_bits_t.BITS8 ? tex_format_t.RGBA32 :
base_bits_handle.position == texture_bits_t.BITS16 ? tex_format_t.RGBA64 :
tex_format_t.RGBA128;
tex_format_t.RGBA128;

///if is_sculpt
format = tex_format_t.RGBA128;
Expand Down

0 comments on commit 7344cd4

Please sign in to comment.