]> git.xonotic.org Git - xonotic/xonotic.git/commitdiff
add a heightsource option so one can "regenerate" normalmaps
authorRudolf Polzer <divverent@alientrap.org>
Fri, 20 Aug 2010 05:11:32 +0000 (07:11 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Fri, 20 Aug 2010 05:11:32 +0000 (07:11 +0200)
misc/tools/normalmap.sh

index 08905b7952a68bba386fd2327eec975d3dfed892..08ca0fae071d882f6b3590e8521e2594f6b9ba19 100755 (executable)
@@ -13,11 +13,14 @@ out=$2
 #   Minimun Z (0 to 1)
 # scale:
 #   Scale (>0)
+# heightsource:
+#   Height source (0 = average RGB, 1 = alpha channel)
 # conv:
 #   Conversion (0 = none, 1 = Biased RGB, 2 = Red, 3 = Green, 4 = Blue, 5 = Max RGB, 6 = Min RGB, 7 = Colorspace)
 : ${filter:=0}
 : ${minz:=0}
 : ${scale:=1}
+: ${heightsource:=0}
 : ${conv:=0}
 
 gimp -i -b - <<EOF
@@ -28,7 +31,7 @@ gimp -i -b - <<EOF
                (layer (car (gimp-image-get-active-layer img)))
        )
        (gimp-layer-add-alpha layer)
-       (plug-in-normalmap RUN-NONINTERACTIVE img drawable $filter $minz $scale 1 0 1 $conv 0 0 1 0 1 layer)
+       (plug-in-normalmap RUN-NONINTERACTIVE img drawable $filter $minz $scale 1 $heightsource 1 $conv 0 0 1 0 1 layer)
        (file-tga-save RUN-NONINTERACTIVE img drawable "$out" "$out" 1 1)
        (gimp-quit 0)
 )