Compare commits

...

1 Commits

Author SHA1 Message Date
Juan Caldas
cecf38f51e add shell script to generate tif files 2025-08-05 08:50:08 -04:00
3 changed files with 79 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
# Copyright (C) 2024 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#!/bin/bash
source test/renderdiff/src/preamble.sh
if [[ "$GITHUB_WORKFLOW" ]]; then
echo "This is meant to run locally (not part of the CI)"
exit 1
else
GOLDEN_BRANCH=$(git log -1 | python3 test/renderdiff/src/commit_msg.py)
fi
./build.sh -f "$@" -p desktop debug gltf_viewer
# -f -W -q arm64-v8a

42
test/gltf-compare/generate.sh Executable file
View File

@@ -0,0 +1,42 @@
#!/bin/bash
# Directory containing the GLTF files
GLTF_DIR="path/to/your/gltf/files"
GLTF_VIEWER_PATH="out/cmake-debug/samples/gltf_viewer"
GLTF_OUT_DIR="`dirname $0`/generated"
echo "The dirname is $GLTF_OUT_DIR"
# echo `dirname $0`
rm -rf $GLTF_OUT_DIR
mkdir -p $GLTF_OUT_DIR
# exit 0
# Base directory for the glTF-Sample-Assets repository
GLTF_SAMPLES_DIR="../glTF-Sample-Assets/Models"
# Loop through each subdirectory in the base directory
find "$GLTF_SAMPLES_DIR" -type f -name "*.gltf" | while read -r gltf_file; do
# Get the base name of the file (e.g., "Box")
base_name=$(basename "$gltf_file" .gltf)
echo "Processing $gltf_file..."
# Run the gltf_viewer command
# You may need to adjust this path based on your project structure
./out/cmake-debug/samples/gltf_viewer --api vulkan --batch=test/gltf-compare/test.json --headless "$gltf_file"
# Rename the generated .js and .tif files
# The generated files are assumed to be in the same directory where the script is run
mv "Base0.tif" "${base_name}.tif"
# Move the newly renamed files to the Output directory
mv "${base_name}.tif" "$GLTF_OUT_DIR/"
echo "Generated files moved to $GLTF_OUT_DIR"
echo "---"
done
echo "Script finished."

View File

@@ -0,0 +1,9 @@
[
{
"name": "Base",
"base": {
"view.postProcessingEnabled": true,
"view.dithering": "NONE"
}
}
]