Fix bake export
This commit is contained in:
@@ -669,6 +669,20 @@ function render_path_paint_is_rt_bake(): bool {
|
|||||||
}
|
}
|
||||||
///end
|
///end
|
||||||
|
|
||||||
|
function render_path_paint_update_bake_layer(bits: texture_bits_t) {
|
||||||
|
// 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
|
||||||
|
if (base_bits_handle.position != texture_bits_t.BITS32) {
|
||||||
|
base_bits_handle.position = bits;
|
||||||
|
slot_layer_resize_and_set_bits(context_raw.layer);
|
||||||
|
for (let i: i32 = 0; i < history_undo_layers.length; ++i) {
|
||||||
|
let l: slot_layer_t = history_undo_layers[i];
|
||||||
|
slot_layer_resize_and_set_bits(l);
|
||||||
|
}
|
||||||
|
base_bits_handle.position = texture_bits_t.BITS8;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function render_path_paint_draw() {
|
function render_path_paint_draw() {
|
||||||
if (!render_path_paint_paint_enabled()) {
|
if (!render_path_paint_paint_enabled()) {
|
||||||
return;
|
return;
|
||||||
@@ -693,10 +707,7 @@ function render_path_paint_draw() {
|
|||||||
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 (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) {
|
if (!render_path_paint_baking && context_raw.pdirty > 0) {
|
||||||
|
|
||||||
// Use RGBA128 texture format for high poly to low poly baking to prevent artifacts
|
render_path_paint_update_bake_layer(texture_bits_t.BITS32);
|
||||||
// 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_baking = true;
|
||||||
_render_path_paint_bake_type = context_raw.bake_type;
|
_render_path_paint_bake_type = context_raw.bake_type;
|
||||||
|
|||||||
Reference in New Issue
Block a user