KirilStrezikozin/BakeMaster-Blender-Addon

BUG: When baking from multiple highpolies, gamma correction is applied more than once

KirilStrezikozin opened this issue · 3 comments

This bug report is:

  • not a duplicate
  • fixed

Describe the bug
@Zatelliti reported on Discord: I'm trying to bake from multiple Highpolies that was imported with 2 texture sets to a single Lowpoly (with 1 texture set). My issue is with Albedo or Diffuse Color as both bake produce same result as expected. The issue is that first highpoly bake is good but 2nd and 3rd are added on top and darkens previous baked area where it should just add nothing. (Default Blender Bake produce expected result). Am I doing something wrong? I have no composite node enabled.

To Reproduce
Steps to reproduce the behavior:

  1. Set up a scene with one lowpoly and three highpoly objects.
  2. Add all to BakeMaster.
  3. Add an AlbedoM map.
  4. Bake it.
  5. Open Image Editor and see gradual darkening with each next highpoly effect baked.

Expected behavior
No darkening since it outputs wrong colors.

Screenshots
Currently:
image
Should be:
image

Desktop (please complete the following information):

  • Any OS
  • Blender 3.6 and Blender 4.0 (at least)
  • BakeMaster 2.5.2

Author's notes:
The solution was to avoid saving the baked image (and therefore applying colorspace) until all of object's highpolies are baked onto it. This prevents file formats like EXR (so far I've noticed this issue happening with it only) have redundant gamma correction applied to an image (the root cause of which is still unknown, probably because BakeMaster uses hard image.save_render, which may dump all image data into its file).

This bug was not connected to any commits that were done on it - the issue is with EXR required to have Linear color space in Blender 4.0, and never sRGB!

Doing the fix of the previous fix now)