Use Luminance instead of R and RG for single and dual channel images#2745
Conversation
|
🖼️ Screenshot tests have failed. The purpose of these tests is to ensure that changes introduced in this PR don't break visual features. They are visual unit tests. 📄 Where to find the report:
✅ If you did mean to change things: ✨ If you are creating entirely new tests: Note; it is very important that the committed reference images are created on the build pipeline, locally created images are not reliable. Similarly tests will fail locally but you can look at the report to check they are "visually similar". See https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-screenshot-tests/README.md for more information Contact @richardTingle (aka richtea) for guidance if required |
There was a problem hiding this comment.
Code Review
This pull request updates the StbImageLoader to use Luminance16F and Luminance16FAlpha16F formats for 16-bit or floating-point images with one or two channels. It also introduces a new screenshot test, TestSingleChannelTexture, to verify the loading of single-channel PNG textures. I have no feedback to provide.
Fixes https://hub.jmonkeyengine.org/t/jme-3-10-0-alpha4/49585/7
The shared image is 16-bit grayscale. The new loader tries to preserve non-8-bit images instead of converting them to 8-bit, so this image ended up being loaded as
R16F.Historically, jME loaded grayscale images as
Luminance8, which behaves like anR8texture with the red channel replicated intoGandB. That is why the rendering looked different.This PR changes the loader to use
Luminance16Ffor this case, so the previous grayscale behavior is restored while still keeping the higher bit depth.