CMGEN(1)
πΈ NAME πΈ
okay so this is CMGEN(1) β section 1, user commands, the good stuff β and the whole page is about cmgen, aka filament material tools β¨. that's the vibe, that's the whole assignment, let's go π
π¦ DESCRIPTION π¦
so cmgen is a command-line tool that generates SH and mipmap levels from an env map. that's the job, bestie, that's what she does π
Cubemaps and equirectangular formats are both supported, and the tool figures out which one you've got automatically β it peeks at the aspect ratio of the source image and just knows. no cap, no config, it reads the vibe check of your file's proportions π
β¨ Usages:
cmgen [options] <input-file>
cmgen [options] <uv[N]>
π Supported input formats:
- PNG
- 8 and 16 bits Radiance (
.hdr) - Photoshop (
.psd) - 16 and 32 bits OpenEXR (
.exr)
she's versatile, she's flexible, she contains multitudes π«Ά
π OPTIONS π
π The standard ones
--help,-hβ prints this message. the "help me bestie" button π₯Ί--licenseβ prints the copyright and license information. the receipts, the legal lore π--quiet,-qβ Quiet mode. Suppress all non-error output. she goes silent, she stops yapping, only screams if something's actually wrong π--type=[cubemap|equirect|octahedron|ktx],-t [cubemap|equirect|octahedron|ktx]β specify the output type. the default iscubemapπΈ--format=[exr|hdr|psd|rgbm|rgb32f|png|dds|ktx],-f [exr|hdr|psd|rgbm|rgb32f|png|dds|ktx]β specify the output file format. heads up:ktximplies-type=ktx. and KTX files are always encoded with 3-channelRGB_10_11_11_REVdata β that's not optional, that's just the rule π--compression=COMPRESSION,-c COMPRESSIONβ format specific compression. and she is format specific fr fr:- KTX:
astc_[fast|thorough]_[ldr|hdr]_WxH, whereWxHis a valid block sizes3tc_rgba_dxt5etc_FORMAT_METRIC_EFFORTFORMATisrgb8_alpha,srgb8_alpha,rgba8, orsrgb8_alpha8METRICisrgba,rgbx,rec709,numeric, ornormalxyzEFFORTis an integer between 0 and 100
- PNG: Ignored
- PNG RGBM: Ignored
- Radiance: Ignored
- Photoshop:
16(default),32 - OpenEXR:
RAW,RLE,ZIPS,ZIP,PIZ(default) - DDS:
8,16(default),32
- KTX:
--size=power-of-two,-s power-of-twoβ Size of the output cubemaps (base level),256by default. Also applies to DFG LUT. little queen, pulling double duty π--deploy=dir,-x dirβ Generate everything needed for deployment into<dir>π¦--extract=dirβ Extract faces of the cubemap into<dir>π§--extract-blur=roughnessβ Blurs the cubemap before saving the faces using the roughness blur. soft focus, glamour shot β¨--clampβ Clamp environment before processing. boundaries, bestie π«Ά--no-mirrorβ Skip mirroring of generated cubemaps (for assets with mirroring already backed in). if your asset already served the mirror look, don't double it π--ibl-samples=numSamplesβ Number of samples to use for IBL integrations (default1024) π₯--ibl-ld=dirβ Roughness pre-filter into<dir>π--sh-shaderβ Generate irradiance SH for shader code. for the shader girlies π
π Private use only:
--ibl-dfg=filename.[exr|hdr|psd|png|rgbm|rgb32f|dds|h|hpp|c|cpp|inc|txt]β Compute the IBL DFG LUT--ibl-dfg-multiscatterβ If--ibl-dfgis set, computes the DFG for multi-scattering GGX--ibl-dfg-clothβ If--ibl-dfgis set, adds a 3rd channel to the DFG for cloth shading--ibl-is-mipmap=dirβ Generate mipmap for pre-filtered importance sampling--ibl-irradiance=dirβ Diffuse irradiance into<dir>--ibl-no-prefilterβ Use importance sampling instead of prefiltered importance sampling--ibl-min-lod-sizeβ Minimum LOD size [default:16]--sh=bandsβ SH decomposition of input cubemap--sh-output=filename.[exr|hdr|psd|rgbm|rgb32f|png|dds|txt]β SH output format. The filename extension determines the output format--sh-irradiance,-iβ Irradiance SH coefficients--sh-window=cutoff|no|auto (default),-w cutoff|no|auto (default)β SH windowing to reduce ringing--debug,-dβ Generate extra data for debugging
π bestie reminder: the stuff under Private use only is literally labeled private use only. it's giving "you can look but this isn't for you." proceed with the appropriate amount of caution π«Ά
π and that's the page π
and oh β quick note that the section at the bottom of this thing is dated October 2021, and the source/version line reads cmgen is a command-line tool f... (yes, it's literally cut off like that in the original, iconic behaviour honestly), all stamped with CMGEN(1). that's a wrap, mwah, go generate some env maps π
β¨
π¦ where this page comes from
- debian bookworm: libfilament-tools 1.9.25+dfsg2-10 Β· Apache-2.0
- debian trixie: libfilament-tools 1.9.25+dfsg3-1+b2 Β· Apache-2.0
- ubuntu jammy: libfilament-tools 1.9.25+dfsg2-4build1 Β· Apache-2.0
- ubuntu questing: libfilament-tools 1.9.25+dfsg3-1
- ubuntu resolute: libfilament-tools 1.9.25+dfsg3-3build2 Β· Apache-2.0
- ubuntu stonking: libfilament-tools 1.9.25+dfsg3-3build2 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms