armortools icon indicating copy to clipboard operation
armortools copied to clipboard

Emission handling seems to be broken

Open l0ud opened this issue 3 years ago • 0 comments

ArmorPaint version: ArmorPaint.org - v0.9 (2022-02-26) - https://github.com/armory3d/armorpaint/commit/4d0c3ae5f72577b71d868d69ef044a641096b5f5 Windows - Direct3D11

Issue description: Emission parameter seems to be stored only in binary form, even through GUI indicates it's a float between 0-1. Bloom effect seems to be applied when emission != 0.0, it can be 0.01 and 1.0 and it will look the same. Exporting emissions seems to check if alpha channel of normal map is equal to 255, which never happens, so exporting emission never works. Similar to issue: https://github.com/armory3d/armorpaint/issues/968 but in my case exported image is all black.

Trying to fix export, I noticed there are alpha values 1, 4, 7 where emission should be. I added test function that does check if (alpha value % 3) == 1. That gave me something that looked like an emission map, but with "glitches" on borders where there are gradients. So apparently that logic is still not correct.

My guess is exporting "binary" emission introduced in: https://github.com/armory3d/armorpaint/commit/0e9e9690175293c94b5eb94016245ed8a93e7389

was broken with this change: https://github.com/armory3d/armorpaint/commit/9da4f074def1ee01580758f8f076612cfd092ce5

Can you please explain how emission is intended to be stored internally? Only in alpha channel of a normal map with a trick to pack intensity and material type=1 in a single float? Or alpha channel is used only to indicate this particular pixel is an emission (not normal), and real value should be stored in a different channel?

l0ud avatar Feb 27 '22 16:02 l0ud