Minimal program to generate ORM (ambient occlusion, roughness, metallicity) textures as specified in the Khronos documentation: https://www.khronos.org/blog/art-pipeline-for-gltf
The channels are:
- Red: AO
- Blue: Roughness
- Green: Metallicity
Usage:
make
./ormGenerate /mnt/c/ambientcg/materials/DiamondPlate007D_2K-JPG/DiamondPlate007D_2K-JPG_Color.jpg jpg
The last parameter is the file format which can be either jpg or png.
An included example can be built with:
make example
The program assumes the folder contains files with the convention:
DiamondPlate007D_2K-JPG_Color.jpg- diffuse, not used by this program but assumed as a base pathDiamondPlate007D_2K-JPG_AmbientOcclusion.jpgDiamondPlate007D_2K-JPG_Roughness.jpgDiamondPlate007D_2K-JPG_Metalness.jpg
Note that:
- If one or several files are missing, they are written as zero in the output ORM.
- If any file has mismatching size or channel count, the program exits with error.
- If any of the input files has over 1 channel, only the red channel is read. Generally speaking, these files should be single channel grayscale images.