From bd84929982d9708861af09a62cf5cdd7e1555de6 Mon Sep 17 00:00:00 2001 From: Deve Date: Mon, 21 Aug 2017 11:27:14 +0200 Subject: [PATCH] Don't convert gloss maps. It causes artifacts when advanced lighting is enabled. --- android/generate_assets.sh | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/android/generate_assets.sh b/android/generate_assets.sh index d0f2f32ec..d3b61a5c4 100755 --- a/android/generate_assets.sh +++ b/android/generate_assets.sh @@ -19,7 +19,7 @@ ################################################################################ -export KARTS="elephpant gnu nolok pidgin suzanne tux xue" +export KARTS="all" export TRACKS="battleisland cornfield_crossing featunlocked gplose gpwin \ hacienda introcutscene introcutscene2 lighthouse olivermath \ overworld sandtrack scotland snowmountain snowtuxpeak \ @@ -42,6 +42,8 @@ export RUN_OPTIMIZE_SCRIPT=0 export DECREASE_QUALITY=1 export CONVERT_TO_JPG=1 +export CONVERT_TO_JPG_BLACKLIST="data/karts/hexley/hexley_kart_diffuse.png" + export BLACKLIST_FILES="data/music/cocoa_river_fast.ogg2" ################################################################################ @@ -276,9 +278,18 @@ convert_to_jpg() if [ $ALREADY_CONVERTED -eq 1 ]; then return fi - - if [ ! -f "$FILE" ]; then - #echo " Couldn't find texture file. Ignore..." + + BLACKLISTED=0 + + for BLACKLIST_FILE in $CONVERT_TO_JPG_BLACKLIST; do + if [ "$FILE" = "assets/$BLACKLIST_FILE" ]; then + BLACKLISTED=1 + break + fi + done + + if [ $BLACKLISTED -eq 1 ]; then + #echo " File is blacklisted. Ignore..." continue fi @@ -304,6 +315,16 @@ convert_to_jpg() continue fi + DIRNAME="`dirname "$FILE"`" + BASENAME="`basename "$FILE"`" + IS_GLOSS_MAP=`find "$DIRNAME" -iname "*.xml" -exec cat {} \; \ + | grep -c "gloss-map=\"$BASENAME\""` + + if [ $IS_GLOSS_MAP -gt 0 ]; then + #echo " File is a gloss-map. Ignore..." + continue + fi + NEW_FILE="`echo $FILE | head -c -5`.jpg" if [ -f "$NEW_FILE" ]; then @@ -526,6 +547,8 @@ fi if [ $CONVERT_TO_JPG -gt 0 ]; then + rm -f "./converted_textures" + find assets/data -not -path "assets/data/textures/*" -iname "*.png" | while read f; do convert_to_jpg "$f"; done find assets/data -iname "*.b3dz" | while read f; do convert_to_jpg_extract_b3dz "$f"; done