Pvalue from .hdr to .float

Hello,

I am using Radiance’s pvalue.exe for the first time. I was using the .hdr from https://www.pauldebevec.com/Probes/ such as the grace catheral but the pvalue result for converting .hdr to .float does not match to the .float that is provided on https://www.pauldebevec.com/Probes/ website.

C:\Radiance\bin\pvalue.exe -df -H -h .\grace_probe.hdr >grace_probe.float

I am wondering if I missed an option? Thanks.

Your command for converting from HDR to raw float appears to be correct. However, the float format on Paul’s website could be a “Poskanzer float map”, which has a short header. Unfortunately, this format is a bit inconsistent the way it’s implemented. Why do you want to convert to float? What program is using raw float?

Thank so much Greg for your reply!

I am using https://graphics.stanford.edu/papers/envmap/prefilter.c which expects the input environment map to be a raw float. It then computes spherical harmonic coefficients. When I tried the .float env map from Paul’s website, it works and outputs the spherical harmonic coefficients correctly. His website suggests to use Radiance’s pvalue to convert from .hdr to .float. From your reply, it sounds like pvalue conversion is missing a short header that the prefilter program expects?

Actually, we have our own environment map in float EXR which I need to convert to .float so I can run the prefilter. Thanks in advance for your suggestion on what is the best way to approach this.

No, I checked, and the grace_probe.float is indeed raw float values with no header, as pvalue should have produced. The difference between the output of pvalue and the .float found on Paul’s website is actually the orientation. His .float is ordered from bottom to top, while the (converted) HDR image is top to bottom. You can get them to match (within some epsilon) using:

pflip -v grace_probe.hdr | pvalue -h -H -df > grace_probe.float

Thanks Greg! I just tried the example you provided but I get a read error.

pflip -v grace_probe.hdr | pvalue -h -H -df > test.float
C:\Radiance\bin\pvalue.exe: read error

I tried to do this in two commands:
pflip -v grace_probe.hdr > test.hdr
pvalue.exe -df -H -h test.hdr > test.float
C:\Radiance\bin\pvalue.exe: missing resolution

Thanks for your help.

It really seems that something is going wrong with the commands. Which version of Radiance do you have installed? Is it the latest? What version of Windows are you using?

If there is something this basic wrong with the Windows distribution, we need to investigate. Other people also seem to be having troubles with some executables, and I’m wondering if it’s related.

Hi Greg,

My download file name is Radiance_6aa34aef_Windows.exe. I am on Windows 10. Not sure if that’s the latest? If there is a better way to install, please let me know. I will be happy to try it.

Thanks for your help!

This is definitely the latest, so we’ll see if we can reproduce your errors on a Windows box. (I don’t have access to one, myself.)

We can’t seem to reproduce this. Is there anything special about your set-up? Are you running a special shell or something?

Hi Greg,

Thanks for mention about the shell. I was running it in Windows Powershell that didn’t work. I just tried it in Cmd prompt and it works! The spherical harmonic between Paul’s grace_probe.float and the pflip and pvalue converted one is pretty close Thank you!

Thanks – I’ll have to tell @Mostapha and others that Powershell is causing problems. I don’t know why it would…

Thanks again for your help!

It is because Powershell can’t pass values through pipeline, basically all values will be encoded to wrong type and corrupted.

2 Likes

Oh I see. Thanks! I am not a Linux user but use Windows because everybody here uses Windows :).

Hi @Chu, can you confirm that using CMD instead resolved your issue?

Yes it does. Thanks for checking in.