Hi, I need some blurred environment maps as the skybox of my scene, I tried to use command ./cmgen --type=equirect --size=2048 --ibl-ld=test ~/Downloads/spruit_sunrise_4k.hdr, but it will downscale the image for each roughness level.
How to avoid this? How to generate those image in a particular size?
Don't use --ibl-ld, use --extract-blur=X --extract=directory instead, where X is a roughness value from 0.0 to 1.0 to control the blur amount. I like to use ~0.09 myself. You can also combine --extract-blur with -x to generate the both the roughness levels for the indirect light and the blurred background:
cmgen -x ~/Desktop/filament_res/env/ --extract-blur=0.08 ~/Documents/Filament/hdr/river.hdr
@romainguy Thanks for your reply, I tried use command: ./cmgen -f=hdr --type=equirect -x test --extract-blur=0.08 spruit_sunrise_4k.hdr, but those output files is always rgb32f format even I specified output file format with -f.
My purpose is to generate several 4k images in different blur level.
@romainguy Oops, my mistake, now the output file format is correct with -f hdr, but the downscale problem still:

Though, now I'm using command ./cmgen -f hdr -s 2048 --type=equirect --extract=test --extract-blur=0.08 spruit_sunrise_4k.hdr to generate blurred image in 4k resolution. Problem solved.
That's because -x is a feature to do everything with one flag so it always generates mip level. --extract= instead of -x is what you want if you want just one high resolution level.
@romainguy
Hi, I got another problem, when I use png file as input, the color of output files looks weird:

Another problem is there will be some stripes after blur, how to fix this?



The color issue is just an encoding bug: we save the image as sRGB but it contains linear data. It should be an easy fix.
As for the "striping" it's simply banding and I would expect this kind of issue from a bandwidth limited like PNG.
Just to be clear: cmgen's main purpose is to process and output HDR data with high bit depth.
The fix should be here: https://github.com/google/filament/pull/1646