Skip to content

Commit

Permalink
Fix: Baking channels with denoise and fxaa turned on still produce no…
Browse files Browse the repository at this point in the history
…isy image
  • Loading branch information
ucupumar committed Jun 22, 2024
1 parent ff7fd40 commit 560f0d2
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions Bake.py
Original file line number Diff line number Diff line change
Expand Up @@ -1554,6 +1554,10 @@ def execute(self, context):
baked = tree.nodes.get(ch.baked)
if baked and baked.image:

# Denoise
if self.denoise and is_greater_than_281():
denoise_image(baked.image)

# AA process
if self.aa_level > 1:
resize_image(baked.image, self.width, self.height,
Expand All @@ -1563,17 +1567,17 @@ def execute(self, context):
if self.fxaa and ch.use_clamp:
fxaa_image(baked.image, ch.enable_alpha, bake_device=self.bake_device)

# Denoise
if self.denoise and is_greater_than_281():
denoise_image(baked.image)

baked_images.append(baked.image)

if ch.type == 'NORMAL':

baked_disp = tree.nodes.get(ch.baked_disp)
if baked_disp and baked_disp.image:

# Denoise
if self.denoise and is_greater_than_281():
denoise_image(baked_disp.image)

# AA process
if self.aa_level > 1:
resize_image(baked_disp.image, self.width, self.height,
Expand All @@ -1583,15 +1587,15 @@ def execute(self, context):
if self.fxaa:
fxaa_image(baked_disp.image, ch.enable_alpha, bake_device=self.bake_device)

# Denoise
if self.denoise and is_greater_than_281():
denoise_image(baked_disp.image)

baked_images.append(baked_disp.image)

baked_normal_overlay = tree.nodes.get(ch.baked_normal_overlay)
if baked_normal_overlay and baked_normal_overlay.image:

# Denoise
if self.denoise and is_greater_than_281():
denoise_image(baked_normal_overlay.image)

# AA process
if self.aa_level > 1:
resize_image(baked_normal_overlay.image, self.width, self.height,
Expand All @@ -1600,10 +1604,6 @@ def execute(self, context):
if self.fxaa:
fxaa_image(baked_normal_overlay.image, ch.enable_alpha, bake_device=self.bake_device)

# Denoise
if self.denoise and is_greater_than_281():
denoise_image(baked_normal_overlay.image)

baked_images.append(baked_normal_overlay.image)

# Set bake info to baked images
Expand Down

0 comments on commit 560f0d2

Please sign in to comment.