Created
February 16, 2023 16:24
-
-
Save leon/b5f6d7496e10ff1556c13ad2007c0021 to your computer and use it in GitHub Desktop.
Convert .hdr to .dds
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Converting HDR" | |
# https://github.com/dariomanesku/cmft | |
SCRIPT_DIR=${0%/*} | |
HDR_FILE=${1%%.*} | |
# 8bits 128x128 | |
# /usr/local/opt/cmft \ | |
# --input $1 \ | |
# --dstFaceSize 128 \ | |
# --output0params dds,BGRA8,cubemap \ | |
# --generateMipChain true \ | |
# --output0 "$SCRIPT_DIR/$HDR_FILE-8bit-128" | |
# 8bits 256x256 | |
# /usr/local/opt/cmft \ | |
# --input $1 \ | |
# --dstFaceSize 256 \ | |
# --output0params dds,BGRA8,cubemap \ | |
# --generateMipChain true \ | |
# --output0 "$SCRIPT_DIR/$HDR_FILE-8bit-256" | |
# 16 bits 128x128 | |
/usr/local/opt/cmft \ | |
--input $1 \ | |
--dstFaceSize 128 \ | |
--output0params dds,rgba16f,cubemap \ | |
--generateMipChain true \ | |
--output0 "$SCRIPT_DIR/$HDR_FILE-16bit-128" | |
# 16 bits 256x256 | |
/usr/local/opt/cmft \ | |
--input $1 \ | |
--dstFaceSize 256 \ | |
--output0params dds,rgba16f,cubemap \ | |
--generateMipChain true \ | |
--output0 "$SCRIPT_DIR/$HDR_FILE-16bit-256" | |
# 16 bits 512x512 | |
/usr/local/opt/cmft \ | |
--input $1 \ | |
--dstFaceSize 512 \ | |
--output0params dds,rgba16f,cubemap \ | |
--generateMipChain true \ | |
--output0 "$SCRIPT_DIR/$HDR_FILE-16bit-512" | |
echo "Done Converting to DDS" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment