Page MenuHome

Fix T97644: new 3.2 obj importer does not always set blend mode for eevee
ClosedPublic

Authored by Aras Pranckevicius (aras_p) on Apr 27 2022, 9:20 PM.

Details

Summary

The old python importer had a "if do_transparency, set blend_method to BLEND" type of logic. This bit was missing in the new importer; it was only setting the eevee blend method when a transparency texture was present, but not in other cases of transparency (as driven by MTL "illum" mode).

Fix the new C++ importer to also do the same logic as the python one did. Fixes T97644.

Diff Detail

Repository
rB Blender

Event Timeline

Aras Pranckevicius (aras_p) requested review of this revision.Apr 27 2022, 9:20 PM
Aras Pranckevicius (aras_p) created this revision.

Does this work for d<1? I haven't tried it but it looks like do_tranparency is whether the illum model has physical/light-based transparency, while dissolve is alpha transparency, independent of illum.

Does this work for d<1? I haven't tried it but it looks like do_tranparency is whether the illum model has physical/light-based transparency, while dissolve is alpha transparency, independent of illum.

No, but I don't see how the old importer was doing that either -- it was only ever setting blend mode if the "illum" value was indicating it, _or_ the transparency texture was present.

It's a good question whether d<1 should also set the blend mode or not. I don't know, so for now I opted to do the same as what the old importer did... any opinions?

Yeah, I saw that, my bad for not checking thoroughly. But isn't it obvious d<1 requires the same thing as map_d? The point is to enable transparency if dissolve is potentially <1, ie if d<1 or map_d is present.

I think we want to make this a drop-in replacement for the python importer to start, and resist the temptation to fix deficiencies of the python importer right away, because that makes it harder to field bug reports from people saying "it doesn't work like the old one". There are a lot of other requests and patches even for improvements to how materials are handled in the python OBJ importer, but I think we should hold off on all of those for now, for the reason I just stated.

This looks fine to commit now.

This revision is now accepted and ready to land.Apr 30 2022, 4:41 PM
Aras Pranckevicius (aras_p) retitled this revision from Fix T89630: new 3.2 obj importer does not always set blend mode for eevee to Fix T97644: new 3.2 obj importer does not always set blend mode for eevee.May 1 2022, 7:10 PM