PBR NaN to half conversion errors

Bug, they are dicks. I spent all friday working why something in my game that had worked for months stopped working despite the fact that i didn’t change anything.

If its the loading code i could have a look. I did work on image loaders and specialty image formats (sat and Doppler radar formats that were in fact undocumented.) How hard can hdr be :wink:

But i am super busy till pax. I need a game that sort of works for the show.

I wonder if it’s not an error in the RLE decoding…
since the weird pixels are in blackish areas, it wouldn’t be a surprise that those are actually duplicate pixels…(like several pixels of the same color next to each other…) RLE encoding “compress” the somehow, and if we fail to decompress, we have wrong values.

1 Like

What files are these? I am looking now. But you know the code better than i.

yeah I’m just thinking out loud don’t worry :))

2 Likes

ok got back to this and found out something.
Seems our loader convert very low values to infinity.
Values like 2.014637E-5 are converted to 32072 as a short. This short is then converted back to a half float resulting in Float.Infinity. And there the issues begins…
So I managed to “fix” it by clamping low values to 0.0001.

But, the issue may be something in our float to half float conversion, I’m not completely sure on how to properly fix it.
Gonna continue to look into it and at worst I’ll implement this work around and commit.

Alright, should be fixed now Changed the minimum value of a float when converting it to half float… · jMonkeyEngine/jmonkeyengine@78fa00b · GitHub

Awesome. Thanks heaps. Just got back from Austrialia. People really liked my tech demo of a game. And really like the PBR rendering. Not that they know what they were looking at.

Again. Thanks heaps.

1 Like