Finished PBR IBL example

This commit is contained in:
saschawillems 2017-04-22 12:05:30 +02:00
parent dba54b09b3
commit 566da6083b
10 changed files with 173 additions and 107 deletions

View file

@ -7,48 +7,42 @@ import glob
APK_NAME = "vulkanPBRIBL"
SHADER_DIR = "pbribl"
ASSETS_MODELS = ["cube.obj", "geosphere.obj", "teapot.dae", "torusknot.obj", "venus.fbx"]
ASSETS_TEXTURES = ["hamarikyu_bridge_radiance_cube.ktx", "hamarikyu_bridge_irradiance_cube.ktx"]
ASSETS_TEXTURES = ["hdr/pisa_cube.ktx"]
if subprocess.call("ndk-build", shell=True) == 0:
if subprocess.call("ndk-build", shell=True) == 0:
print("Build successful")
# Assets
if not os.path.exists("./assets"):
os.makedirs("./assets")
os.makedirs("./assets/shaders/base", exist_ok=True)
os.makedirs("./assets/shaders/%s" % SHADER_DIR, exist_ok=True)
os.makedirs("./assets/textures/hdr", exist_ok=True)
os.makedirs("./assets/models", exist_ok=True)
os.makedirs("./res/drawable", exist_ok=True)
# Shaders
# Shaders
# Base
if not os.path.exists("./assets/shaders/base"):
os.makedirs("./assets/shaders/base")
for file in glob.glob("../../data/shaders/base/*.spv"):
shutil.copy(file, "./assets/shaders/base")
shutil.copy(file, "./assets/shaders/base")
# Sample
if not os.path.exists("./assets/shaders/%s" % SHADER_DIR):
os.makedirs("./assets/shaders/%s" % SHADER_DIR)
for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR):
shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR)
shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR)
# Textures
if not os.path.exists("./assets/textures"):
os.makedirs("./assets/textures")
for file in ASSETS_TEXTURES:
shutil.copy("../../data/textures/%s" % file, "./assets/textures")
shutil.copy("../../data/textures/%s" % file, "./assets/textures/hdr")
# Models
if not os.path.exists("./assets/models"):
os.makedirs("./assets/models")
for file in ASSETS_MODELS:
shutil.copy("../../data/models/%s" % file, "./assets/models")
# Icon
if not os.path.exists("./res/drawable"):
os.makedirs("./res/drawable")
shutil.copy("../../android/images/icon.png", "./res/drawable")
shutil.copy("../../android/images/icon.png", "./res/drawable")
if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0:
if len(sys.argv) > 1:
if sys.argv[1] == "-deploy":
for arg in sys.argv[1:]:
if arg == "-deploy":
if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0:
print("Could not deploy to device!")
else:
print("Error during build process!")
else:
print("Error building project!")