KirilStrezikozin / BakeMaster-Blender-Addon

Welcome to BakeMaster, a powerful and feature-packed baking solution created for Blender - an open-source 3D Computer graphics software.
Other
34 stars 6 forks source link

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

Closed KirilStrezikozin closed 6 months ago

KirilStrezikozin commented 9 months ago

This bug report is:

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):

KirilStrezikozin commented 9 months ago

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).

KirilStrezikozin commented 9 months ago

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!

KirilStrezikozin commented 9 months ago

Doing the fix of the previous fix now)