Hi There.
I have cloned playcanvas viewer repo and performing several testing. However, somehow failed to load large size hdr.
The size is 5000 x 2500
When I tried to load the hdr as the skybox, it failed with “radiance has invalid scanline width” message.
So, I tracked the message and commented out the following part from hdr-texture.js
// if (rgbe[2] << 8 + rgbe[3] != width) {
// this._error("radiance has invalid scanline width");
// return null;
// }
Then it successfully loaded the hdr as skybox.
However, I found a small gap between the beginning and the end of the hdr image.
Can you kindly let me know how to fix it?
Thanks.
1 Like
yaustar
February 23, 2021, 4:51pm
#2
@slimbuck Is our resident sky box domain expert who is unfortunately away this week
moka
February 23, 2021, 5:30pm
#4
Generally, it is not recommended to use non power of 2 resolutions, especially if you intent to support iOS (WebGL 1).
Can you load your large file in some other software without problem?
Hi @sooyong_Kim ,
Please check that the file is valid and loads correctly elsewhere (like gimp or photoshop).
If the HDR works correctly there and you don’t mind sharing the file with us, we can take a look and hopefully fix any issues with the loader.
Thanks!
I created a 5000x2500 HDR file in gimp and the viewer loaded it fine.
My guess is your file is either unique or corrupt.
Either way, let us know!
The HDR file is a copyrighted one. I can share it with you personally. (Please don’t use it for elsewhere…
let me know your email address.
Thanks.
yaustar
February 24, 2021, 7:39am
#10
I sent an email with two problematic hdr images.
1 Like
Hi @sooyong_Kim ,
Thanks for providing the HDR. Here is the PR to fix the width test.
As for the invalid column of pixels, this is happening because the image is not a power of two. I will address this issue in a different PR (since it is most likely a bug in the engine not in the viewer). Till then, you can get this to work by resizing the image to 4096x2048. (Which, as @moka mentioned may be a good idea anyway).
Thanks!
1 Like
will
February 25, 2021, 12:58pm
#13
I’ve merged the fix from @slimbuck and redeployed the viewer .
I’ve checked out the viewer source but it still doesn’t work… Can you check again?
will
March 2, 2021, 9:22am
#15
I just tried loading your HDR file (after resizing it to 4096x2048) and it worked fine. I’ll direct message you a video (but please reply here).
Should I resize the image? Can’t I use it as out of box?
will
March 2, 2021, 10:23am
#17
Yes, for now, you need to make it 4096x2048. @slimbuck said the following above:
slimbuck:
As for the invalid column of pixels, this is happening because the image is not a power of two. I will address this issue in a different PR (since it is most likely a bug in the engine not in the viewer). Till then, you can get this to work by resizing the image to 4096x2048. (Which, as @moka mentioned may be a good idea anyway).
When he has created that fix, you won’t need to make the HDR power-of-two in dimensions.
Thanks~!!! Hoping this issue will be fixed soon~!!!
1 Like
Do you have any plan to merge those hdr-parser into playcanvas engine???
yaustar
March 11, 2021, 12:12pm
#20
Are you referring to the non power of 2 fix? If so, we haven’t yet started work on that issue yet.
will
March 11, 2021, 12:24pm
#21
One issue is that @slimbuck patched hdr-texture.js in the viewer repo , but not the original version of that script in the engine repo .
Those files seem to be diverging a bit now, so we should resolve that.