kool-engine/kool

Question: What is the hdri environment image encoding type ?

Closed this issue · 2 comments

Hi, I would like to render an hdri sky environment on my scene but I don't understand the format of the image used on the demo.
How can I generate them ?
Thank you

The HDRIs are in the RGBe format, which stores HDR image information in regular 8-bit color channels (by using the alpha channel as a per-pixel exponent). I thought there were web-based conversion-utils but I wasn't able to quickly find one, so I added my conversion code for the jvm platform.

It should be straightforward to convert a regular hdri with it:

fun main() {
    val inputFile = File("path/to/inputImage.hdr")
    val outputFile = File("path/to/outputImage.rgbe.png")
    val rgbeImage = HdrImageConversion.convertHdrImageToRgbe(inputFile)
    ImageIO.write(rgbeImage, "png", outputFile)
}

A good source to find more HDRIs is Poly Haven

Amazing, thanks !