Page MenuHome

Fix T60098: Cycles does not respect the texture alpha mode
Needs RevisionPublic

Authored by Sebastian Parborg (zeddb) on Jan 3 2019, 1:21 AM.

Details

Summary

This is my initial take on this issue. Of course there is still a bit left to do so I do not expect this to be accepted as is.

First of all, perhaps we should merge use_alpha and alpha_mode into one enum flag?
IE:

0 = !use_alpha
1 = use_alpha && strait
2 = use_alpha && pre...

If not, where should I add the enums for alpha_mode?

I also noticed that a check in image.cpp seems redundant as it will never trigger (?). I've marked it as TODO

Additionally, this patch doesn't work with packed images. Is the cycles textures not reloaded properly?

Diff Detail

Event Timeline

Updated to use enums.

Still not working as intended with baked textures though...

I've now updated the patch to take the alpha setting into account for baked textures as well.

Brecht Van Lommel (brecht) requested changes to this revision.Jun 6 2019, 6:16 PM

There were a lot of code changes recently in this area, but this specific issue is still not solved I think. Basically we still rely on Cycles to auto detect the alpha mode of the final rather than following Blender.

This patch is not quite correct though. Two things to take into account.

  • The alpha mode is what we need to convert from.
  • oiio:UnassociatedAlpha control if OIIO will automatically associate alpha when file formats with non-associated alpha. If we want to follow the Blender settings exactly, we must never use this auto detection.
This revision now requires changes to proceed.Jun 6 2019, 6:16 PM