Grayscale Targa images (Type 3) don't render as grayscale
Wuzzy2 opened this issue · comments
Minetest version
a66e6d4dff0b1dad065297442981718d7f7aec55
Summary
The type 3 Targa test nodes in DevTest don't render as grayscale. Instead, the letters "T" and "A" on the test nodes appear yellow for some reason.
Steps to reproduce
- Launch DevTest
- Place the type 3 Targa test nodes
This is where grayscale decoding is handled:
- https://github.com/minetest/irrlicht/blob/372b3642bf524da2694cc09bdc8bdacb23f5fd0e/source/Irrlicht/CImageLoaderTGA.cpp#L150
- https://github.com/minetest/irrlicht/blob/372b3642bf524da2694cc09bdc8bdacb23f5fd0e/source/Irrlicht/CImageLoaderTGA.cpp#L176
The function I think it uses is convert8BitTo24Bit()
, which “converts a 8 bit palettized or non palettized image (A8) into R8G8B8”:
Maybe that helps.
@Wuzzy I have a suspicion. I think if these are 16 bit grayscale images, they should have one alpha channel and one grayscale channel. However, the engine might treat them as A1R5G5B5 16 bit color images instead. This could be verified with a debugger, or with a mod that contains a single printf in each decoding path.