diff --git a/CMakeLists.txt b/CMakeLists.txt index 9dfeb1d9ee..1c14c40063 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -515,6 +515,7 @@ endif() if (NOT ANDROID AND NOT WEBGL AND NOT IOS) add_subdirectory(${LIBRARIES}/bluegl) + add_subdirectory(${LIBRARIES}/filamentapp) add_subdirectory(${LIBRARIES}/filagui) add_subdirectory(${LIBRARIES}/imageio) add_subdirectory(${LIBRARIES}/matdbg) diff --git a/libs/filamentapp/CMakeLists.txt b/libs/filamentapp/CMakeLists.txt new file mode 100644 index 0000000000..b85ecdc9a6 --- /dev/null +++ b/libs/filamentapp/CMakeLists.txt @@ -0,0 +1,148 @@ +cmake_minimum_required(VERSION 3.10) +project(filamentapp C ASM) + +if (FILAMENT_SKIP_SAMPLES) + return() +endif() + +set(TARGET filamentapp) +set(PUBLIC_HDR_DIR include) + +set(ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/..) +set(GENERATION_ROOT ${CMAKE_CURRENT_BINARY_DIR}) +set(RESOURCE_DIR "${GENERATION_ROOT}/generated/resources") +set(MATERIAL_DIR "${GENERATION_ROOT}/generated/material") + +# ================================================================================================== +# Headers, sources, libraries, and resources. +# ================================================================================================== + +set(PUBLIC_HDRS + include/filamentapp/Config.h + include/filamentapp/Cube.h + include/filamentapp/FilamentApp.h + include/filamentapp/IBL.h + include/filamentapp/IcoSphere.h + include/filamentapp/MeshAssimp.h + include/filamentapp/NativeWindowHelper.h + include/filamentapp/Sphere.h +) + +set(SRCS + src/Cube.cpp + src/FilamentApp.cpp + src/IBL.cpp + src/IcoSphere.cpp + src/Image.cpp + src/MeshAssimp.cpp + src/Sphere.cpp +) + +set(LIBS + assimp + filament + sdl2 + stb + math + filamat + utils + getopt + imgui + filagui + image + camutils +) + +set(MATERIAL_SRCS + materials/aiDefaultMat.mat + materials/aiDefaultTrans.mat + materials/depthVisualizer.mat + materials/transparentColor.mat +) + +if (APPLE) + list(APPEND SRCS src/NativeWindowHelperCocoa.mm) + list(APPEND LIBS "-framework Cocoa -framework QuartzCore") +endif() + +if (LINUX) + list(APPEND SRCS src/NativeWindowHelperLinux.cpp) +endif() + +if (WIN32) + list(APPEND SRCS src/NativeWindowHelperWindows.cpp) + list(APPEND LIBS sdl2main) +endif() + +# ================================================================================================== +# Compile resources +# ================================================================================================== + +if (CMAKE_CROSSCOMPILING) + include(${IMPORT_EXECUTABLES}) +endif() + +file(MAKE_DIRECTORY ${MATERIAL_DIR}) +file(MAKE_DIRECTORY ${RESOURCE_DIR}) + +set(RESOURCE_BINS) +foreach (mat_src ${MATERIAL_SRCS}) + get_filename_component(localname "${mat_src}" NAME_WE) + get_filename_component(fullname "${mat_src}" ABSOLUTE) + set(output_path "${MATERIAL_DIR}/${localname}.filamat") + add_custom_command( + OUTPUT ${output_path} + COMMAND matc ${MATC_BASE_FLAGS} -o ${output_path} ${fullname} + MAIN_DEPENDENCY ${mat_src} + DEPENDS matc + COMMENT "Compiling material ${mat_src} to ${output_path}" + ) + list(APPEND RESOURCE_BINS ${output_path}) +endforeach() + +get_resgen_vars(${RESOURCE_DIR} filamentapp) + +add_custom_command( + OUTPUT ${RESGEN_OUTPUTS} + COMMAND resgen ${RESGEN_FLAGS} ${RESOURCE_BINS} + DEPENDS resgen ${RESOURCE_BINS} + COMMENT "Aggregating resources" +) + +if (DEFINED RESGEN_SOURCE_FLAGS) + set_source_files_properties(${RESGEN_SOURCE} PROPERTIES COMPILE_FLAGS ${RESGEN_SOURCE_FLAGS}) +endif() + +# CMake fails to invoke ar on Windows unless there is at least one C/C++ file in the library. +set(DUMMY_SRC "${RESOURCE_DIR}/dummy.c") +add_custom_command(OUTPUT ${DUMMY_SRC} COMMAND echo "//" > ${DUMMY_SRC}) + +add_library(filamentapp-resources ${DUMMY_SRC} ${RESGEN_SOURCE}) + +# ================================================================================================== +# Include and target definitions +# ================================================================================================== + +include_directories(${PUBLIC_HDR_DIR}) + +add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) + +target_link_libraries(${TARGET} PUBLIC ${LIBS} filamentapp-resources) + +target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) +target_include_directories(${TARGET} PRIVATE ${GENERATION_ROOT}) + +# ================================================================================================== +# Compiler flags +# ================================================================================================== + +if (MSVC) + target_compile_options(${TARGET} PRIVATE $<$:/fp:fast>) +else() + target_compile_options(${TARGET} PRIVATE $<$:-ffast-math>) + target_compile_options(${TARGET} PRIVATE -Wno-deprecated-register) +endif() + +if (LINUX) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") +endif() diff --git a/samples/app/Config.h b/libs/filamentapp/include/filamentapp/Config.h similarity index 100% rename from samples/app/Config.h rename to libs/filamentapp/include/filamentapp/Config.h diff --git a/samples/app/Cube.h b/libs/filamentapp/include/filamentapp/Cube.h similarity index 100% rename from samples/app/Cube.h rename to libs/filamentapp/include/filamentapp/Cube.h diff --git a/samples/app/FilamentApp.h b/libs/filamentapp/include/filamentapp/FilamentApp.h similarity index 100% rename from samples/app/FilamentApp.h rename to libs/filamentapp/include/filamentapp/FilamentApp.h diff --git a/samples/app/IBL.h b/libs/filamentapp/include/filamentapp/IBL.h similarity index 100% rename from samples/app/IBL.h rename to libs/filamentapp/include/filamentapp/IBL.h diff --git a/samples/app/IcoSphere.h b/libs/filamentapp/include/filamentapp/IcoSphere.h similarity index 100% rename from samples/app/IcoSphere.h rename to libs/filamentapp/include/filamentapp/IcoSphere.h diff --git a/samples/app/MeshAssimp.h b/libs/filamentapp/include/filamentapp/MeshAssimp.h similarity index 100% rename from samples/app/MeshAssimp.h rename to libs/filamentapp/include/filamentapp/MeshAssimp.h diff --git a/samples/app/NativeWindowHelper.h b/libs/filamentapp/include/filamentapp/NativeWindowHelper.h similarity index 100% rename from samples/app/NativeWindowHelper.h rename to libs/filamentapp/include/filamentapp/NativeWindowHelper.h diff --git a/samples/app/Sphere.h b/libs/filamentapp/include/filamentapp/Sphere.h similarity index 100% rename from samples/app/Sphere.h rename to libs/filamentapp/include/filamentapp/Sphere.h diff --git a/libs/filamentapp/materials/aiDefaultMat.mat b/libs/filamentapp/materials/aiDefaultMat.mat new file mode 100644 index 0000000000..ceb456fe6c --- /dev/null +++ b/libs/filamentapp/materials/aiDefaultMat.mat @@ -0,0 +1,32 @@ +material { + name : aiDefaultMat, + shadingModel : lit, + parameters : [ + { + type : float3, + name : baseColor + }, + { + type : float, + name : metallic + }, + { + type : float, + name : roughness + }, + { + type : float, + name : reflectance + } + ], +} + +fragment { + void material(inout MaterialInputs material) { + prepareMaterial(material); + material.baseColor.rgb = materialParams.baseColor; + material.metallic = materialParams.metallic; + material.roughness = materialParams.roughness; + material.reflectance = materialParams.reflectance; + } +} diff --git a/samples/materials/aiDefaultTrans.mat b/libs/filamentapp/materials/aiDefaultTrans.mat similarity index 100% rename from samples/materials/aiDefaultTrans.mat rename to libs/filamentapp/materials/aiDefaultTrans.mat diff --git a/libs/filamentapp/materials/depthVisualizer.mat b/libs/filamentapp/materials/depthVisualizer.mat new file mode 100644 index 0000000000..05b9d49559 --- /dev/null +++ b/libs/filamentapp/materials/depthVisualizer.mat @@ -0,0 +1,14 @@ +material { + name : depthVisualizer, + shadingModel : unlit, +} + +fragment { + void material(inout MaterialInputs material) { + prepareMaterial(material); + const float n = 0.1; + const float f = 35.0; + float linearZ = (2.0 * n) / (f + n - gl_FragCoord.z * (f - n)); + material.baseColor.rgb = float3(linearZ); + } +} diff --git a/libs/filamentapp/materials/transparentColor.mat b/libs/filamentapp/materials/transparentColor.mat new file mode 100644 index 0000000000..c43f9410e7 --- /dev/null +++ b/libs/filamentapp/materials/transparentColor.mat @@ -0,0 +1,20 @@ +material { + name : transparentColor, + parameters : [ + { + type : float4, + name : color + } + ], + blending : transparent, + culling : none, + depthCulling : false, + shadingModel : unlit +} + +fragment { + void material(inout MaterialInputs material) { + prepareMaterial(material); + material.baseColor = materialParams.color; + } +} diff --git a/samples/app/Cube.cpp b/libs/filamentapp/src/Cube.cpp similarity index 99% rename from samples/app/Cube.cpp rename to libs/filamentapp/src/Cube.cpp index da55ceaeae..cd2faa0bc0 100644 --- a/samples/app/Cube.cpp +++ b/libs/filamentapp/src/Cube.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "Cube.h" +#include #include #include diff --git a/samples/app/FilamentApp.cpp b/libs/filamentapp/src/FilamentApp.cpp similarity index 98% rename from samples/app/FilamentApp.cpp rename to libs/filamentapp/src/FilamentApp.cpp index cee24332de..46688ed72d 100644 --- a/samples/app/FilamentApp.cpp +++ b/libs/filamentapp/src/FilamentApp.cpp @@ -16,7 +16,7 @@ * limitations under the License. */ -#include "FilamentApp.h" +#include #if !defined(WIN32) # include @@ -43,12 +43,12 @@ #include -#include "Cube.h" -#include "NativeWindowHelper.h" +#include +#include #include -#include "generated/resources/resources.h" +#include "generated/resources/filamentapp.h" using namespace filament; using namespace filagui; @@ -81,17 +81,17 @@ void FilamentApp::run(const Config& config, SetupCallback setupCallback, new FilamentApp::Window(this, config, config.title, width, height)); mDepthMaterial = Material::Builder() - .package(RESOURCES_DEPTHVISUALIZER_DATA, RESOURCES_DEPTHVISUALIZER_SIZE) + .package(FILAMENTAPP_DEPTHVISUALIZER_DATA, FILAMENTAPP_DEPTHVISUALIZER_SIZE) .build(*mEngine); mDepthMI = mDepthMaterial->createInstance(); mDefaultMaterial = Material::Builder() - .package(RESOURCES_AIDEFAULTMAT_DATA, RESOURCES_AIDEFAULTMAT_SIZE) + .package(FILAMENTAPP_AIDEFAULTMAT_DATA, FILAMENTAPP_AIDEFAULTMAT_SIZE) .build(*mEngine); mTransparentMaterial = Material::Builder() - .package(RESOURCES_TRANSPARENTCOLOR_DATA, RESOURCES_TRANSPARENTCOLOR_SIZE) + .package(FILAMENTAPP_TRANSPARENTCOLOR_DATA, FILAMENTAPP_TRANSPARENTCOLOR_SIZE) .build(*mEngine); std::unique_ptr cameraCube(new Cube(*mEngine, mTransparentMaterial, {1,0,0})); diff --git a/samples/app/IBL.cpp b/libs/filamentapp/src/IBL.cpp similarity index 99% rename from samples/app/IBL.cpp rename to libs/filamentapp/src/IBL.cpp index 3532a04b76..a5bf50ec84 100644 --- a/samples/app/IBL.cpp +++ b/libs/filamentapp/src/IBL.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "IBL.h" +#include #include #include diff --git a/samples/app/IcoSphere.cpp b/libs/filamentapp/src/IcoSphere.cpp similarity index 98% rename from samples/app/IcoSphere.cpp rename to libs/filamentapp/src/IcoSphere.cpp index 3cfaa65d81..d1a797a35a 100644 --- a/samples/app/IcoSphere.cpp +++ b/libs/filamentapp/src/IcoSphere.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "IcoSphere.h" +#include #include diff --git a/samples/app/Image.cpp b/libs/filamentapp/src/Image.cpp similarity index 100% rename from samples/app/Image.cpp rename to libs/filamentapp/src/Image.cpp diff --git a/samples/app/MeshAssimp.cpp b/libs/filamentapp/src/MeshAssimp.cpp similarity index 99% rename from samples/app/MeshAssimp.cpp rename to libs/filamentapp/src/MeshAssimp.cpp index 113ba35617..babf7505a5 100644 --- a/samples/app/MeshAssimp.cpp +++ b/libs/filamentapp/src/MeshAssimp.cpp @@ -25,7 +25,7 @@ #define GL_TEXTURE_WRAP_S 0x2802 #define GL_TEXTURE_WRAP_T 0x2803 -#include "MeshAssimp.h" +#include #include #include @@ -57,7 +57,7 @@ #include -#include "generated/resources/resources.h" +#include "generated/resources/filamentapp.h" using namespace filament; using namespace filamat; @@ -261,7 +261,7 @@ MeshAssimp::MeshAssimp(Engine& engine) : mEngine(engine) { mDefaultNormalMap = createOneByOneTexture(0xffff8080); mDefaultColorMaterial = Material::Builder() - .package(RESOURCES_AIDEFAULTMAT_DATA, RESOURCES_AIDEFAULTMAT_SIZE) + .package(FILAMENTAPP_AIDEFAULTMAT_DATA, FILAMENTAPP_AIDEFAULTMAT_SIZE) .build(mEngine); mDefaultColorMaterial->setDefaultParameter("baseColor", RgbType::LINEAR, float3{0.8}); @@ -270,7 +270,7 @@ MeshAssimp::MeshAssimp(Engine& engine) : mEngine(engine) { mDefaultColorMaterial->setDefaultParameter("reflectance", 0.5f); mDefaultTransparentColorMaterial = Material::Builder() - .package(RESOURCES_AIDEFAULTTRANS_DATA, RESOURCES_AIDEFAULTTRANS_SIZE) + .package(FILAMENTAPP_AIDEFAULTTRANS_DATA, FILAMENTAPP_AIDEFAULTTRANS_SIZE) .build(mEngine); mDefaultTransparentColorMaterial->setDefaultParameter("baseColor", RgbType::LINEAR, float3{0.8}); diff --git a/samples/app/NativeWindowHelperCocoa.mm b/libs/filamentapp/src/NativeWindowHelperCocoa.mm similarity index 97% rename from samples/app/NativeWindowHelperCocoa.mm rename to libs/filamentapp/src/NativeWindowHelperCocoa.mm index 6a1fc81a06..1d86b5ded1 100644 --- a/samples/app/NativeWindowHelperCocoa.mm +++ b/libs/filamentapp/src/NativeWindowHelperCocoa.mm @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "NativeWindowHelper.h" +#include #include diff --git a/samples/app/NativeWindowHelperLinux.cpp b/libs/filamentapp/src/NativeWindowHelperLinux.cpp similarity index 95% rename from samples/app/NativeWindowHelperLinux.cpp rename to libs/filamentapp/src/NativeWindowHelperLinux.cpp index f032ba2ef0..a24370b051 100644 --- a/samples/app/NativeWindowHelperLinux.cpp +++ b/libs/filamentapp/src/NativeWindowHelperLinux.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "NativeWindowHelper.h" +#include #include diff --git a/samples/app/NativeWindowHelperWindows.cpp b/libs/filamentapp/src/NativeWindowHelperWindows.cpp similarity index 95% rename from samples/app/NativeWindowHelperWindows.cpp rename to libs/filamentapp/src/NativeWindowHelperWindows.cpp index 8d0219d7c1..38d53bd9ca 100644 --- a/samples/app/NativeWindowHelperWindows.cpp +++ b/libs/filamentapp/src/NativeWindowHelperWindows.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "NativeWindowHelper.h" +#include #include diff --git a/samples/app/Sphere.cpp b/libs/filamentapp/src/Sphere.cpp similarity index 98% rename from samples/app/Sphere.cpp rename to libs/filamentapp/src/Sphere.cpp index 6d7978aea5..53b6ff2960 100644 --- a/samples/app/Sphere.cpp +++ b/libs/filamentapp/src/Sphere.cpp @@ -15,7 +15,7 @@ */ -#include "Sphere.h" +#include #include #include @@ -26,7 +26,7 @@ #include #include -#include "IcoSphere.h" +#include using namespace filament; using namespace filament::math; diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt index 542c805162..25ed22658e 100644 --- a/samples/CMakeLists.txt +++ b/samples/CMakeLists.txt @@ -34,13 +34,11 @@ add_mesh("assets/models/monkey/monkey.obj" "suzanne.filamesh") # ================================================================================================== set(MATERIAL_SRCS + materials/aiDefaultMat.mat materials/bakedColor.mat materials/bakedTexture.mat materials/pointSprites.mat materials/aoPreview.mat - materials/aiDefaultMat.mat - materials/aiDefaultTrans.mat - materials/depthVisualizer.mat materials/groundShadow.mat materials/heightfield.mat materials/sandboxCloth.mat @@ -54,8 +52,7 @@ set(MATERIAL_SRCS materials/sandboxSpecGloss.mat materials/sandboxSubsurface.mat materials/sandboxUnlit.mat - materials/texturedLit.mat - materials/transparentColor.mat) + materials/texturedLit.mat) if (CMAKE_CROSSCOMPILING) include(${IMPORT_EXECUTABLES}) @@ -78,7 +75,7 @@ foreach (mat_src ${MATERIAL_SRCS}) endforeach() # ================================================================================================== -# Build common resources +# Build sample resources # ================================================================================================== file(MAKE_DIRECTORY ${RESOURCE_DIR}) @@ -100,7 +97,7 @@ endif() set(DUMMY_SRC "${RESOURCE_DIR}/dummy.c") add_custom_command(OUTPUT ${DUMMY_SRC} COMMAND echo "//" > ${DUMMY_SRC}) -add_library(common-resources ${DUMMY_SRC} ${RESGEN_SOURCE}) +add_library(sample-resources ${DUMMY_SRC} ${RESGEN_SOURCE}) # ================================================================================================== # Invoke cmgen to build KTX files for the default IBL and skybox @@ -172,7 +169,6 @@ endif() add_library(suzanne-resources ${DUMMY_SRC} ${RESGEN_SOURCE}) - # ================================================================================================== # Resources for gltf_viewer # ================================================================================================== @@ -198,56 +194,6 @@ endif() target_sources(gltf-resources PRIVATE ${RESGEN_SOURCE}) -# ================================================================================================== -# Common library -# ================================================================================================== - -set(APP_LIBS filament sdl2 stb math filamat utils getopt imgui filagui image camutils common-resources) -if (WIN32) - list(APPEND APP_LIBS sdl2main) -endif() - -set(APP_SRCS - app/Cube.cpp - app/FilamentApp.cpp - app/IBL.cpp - app/IcoSphere.cpp - app/Sphere.cpp - app/Image.cpp - ) - -if (APPLE) - list(APPEND APP_SRCS app/NativeWindowHelperCocoa.mm) - list(APPEND APP_LIBS "-framework Cocoa -framework QuartzCore") -endif() - -if (LINUX) - list(APPEND APP_SRCS app/NativeWindowHelperLinux.cpp) -endif() - -if (WIN32) - list(APPEND APP_SRCS app/NativeWindowHelperWindows.cpp) -endif() - -include_directories(app) - -add_library(sample-app ${APP_SRCS}) -target_include_directories(sample-app PUBLIC app) - -# Multi-configuration generators, like Visual Studio or Xcode, place executable binaries in a -# sub-directory named after the configuration, like "Debug" or "Release". -# For these generators, in order to find assets, we must "walk" up an additional directory. -get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) -if (_isMultiConfig) - target_compile_definitions(sample-app PRIVATE RELATIVE_ASSET_PATH="..") -else() - target_compile_definitions(sample-app PRIVATE RELATIVE_ASSET_PATH=".") -endif() - -target_link_libraries(sample-app PRIVATE ${APP_LIBS}) - -list(APPEND APP_LIBS sample-app) - # ================================================================================================== # Compiler flags # ================================================================================================== @@ -265,36 +211,35 @@ endif() # Test apps # ================================================================================================== -function(add_assimp_demo NAME) +# Multi-configuration generators, like Visual Studio or Xcode, place executable binaries in a +# sub-directory named after the configuration, like "Debug" or "Release". +# For these generators, in order to find assets, we must "walk" up an additional directory. +get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) + +function(add_demo NAME) include_directories(${GENERATION_ROOT}) - add_executable( - ${NAME} - ${NAME}.cpp - app/MeshAssimp.cpp) - target_link_libraries(${NAME} PRIVATE ${APP_LIBS} assimp) + add_executable(${NAME} ${NAME}.cpp) + target_link_libraries(${NAME} PRIVATE sample-resources filamentapp filameshio) target_compile_options(${NAME} PRIVATE ${COMPILER_FLAGS}) + if (_isMultiConfig) + target_compile_definitions(${NAME} PRIVATE RELATIVE_ASSET_PATH="..") + else() + target_compile_definitions(${NAME} PRIVATE RELATIVE_ASSET_PATH=".") + endif() endfunction() -function(add_filamesh_demo NAME) - include_directories(${GENERATION_ROOT}) - add_executable( - ${NAME} - ${NAME}.cpp) - target_link_libraries(${NAME} PRIVATE ${APP_LIBS} filameshio) - target_compile_options(${NAME} PRIVATE ${COMPILER_FLAGS}) -endfunction() if (NOT ANDROID) - add_assimp_demo(frame_generator) - add_assimp_demo(lightbulb) - add_assimp_demo(material_sandbox) - add_assimp_demo(sample_full_pbr) - - add_filamesh_demo(point_sprites) - add_filamesh_demo(sample_cloth) - add_filamesh_demo(sample_normal_map) - add_filamesh_demo(suzanne) - add_filamesh_demo(gltf_viewer) + add_demo(frame_generator) + add_demo(gltf_viewer) + add_demo(heightfield) + add_demo(lightbulb) + add_demo(material_sandbox) + add_demo(point_sprites) + add_demo(sample_cloth) + add_demo(sample_full_pbr) + add_demo(sample_normal_map) + add_demo(suzanne) # Sample app specific target_link_libraries(frame_generator PRIVATE imageio) @@ -303,9 +248,21 @@ if (NOT ANDROID) endif() -add_executable(heightfield heightfield.cpp) -target_link_libraries(heightfield PRIVATE ${APP_LIBS}) -target_compile_options(heightfield PRIVATE ${COMPILER_FLAGS}) +# ================================================================================================== +# Build Vulkan Executables +# ================================================================================================== + +if (FILAMENT_SUPPORTS_VULKAN) + add_demo(animation) + add_demo(depthtesting) + add_demo(hellopbr) + add_demo(hellotriangle) + add_demo(shadowtest) + add_demo(strobecolor) + add_demo(texturedquad) + add_demo(vbotest) + add_demo(viewtest) +endif() # ================================================================================================== # Copy the MoltenVK dylibs and JSON on MacOS @@ -329,22 +286,6 @@ if (APPLE AND NOT Vulkan_LIBRARY) ${PROJECT_BINARY_DIR}/libMoltenVK.dylib) endif() -# ================================================================================================== -# Build Vulkan Executables -# ================================================================================================== - -if (FILAMENT_SUPPORTS_VULKAN) - add_assimp_demo(shadowtest) - add_filamesh_demo(animation) - add_filamesh_demo(depthtesting) - add_filamesh_demo(hellopbr) - add_filamesh_demo(hellotriangle) - add_filamesh_demo(strobecolor) - add_filamesh_demo(texturedquad) - add_filamesh_demo(vbotest) - add_filamesh_demo(viewtest) -endif() - # ================================================================================================== # Copy Assets # diff --git a/samples/animation.cpp b/samples/animation.cpp index e045605127..004a455f0b 100644 --- a/samples/animation.cpp +++ b/samples/animation.cpp @@ -27,8 +27,8 @@ #include -#include "../samples/app/Config.h" -#include "../samples/app/FilamentApp.h" +#include "filamentapp/Config.h" +#include "filamentapp/FilamentApp.h" #include diff --git a/samples/depthtesting.cpp b/samples/depthtesting.cpp index ea9146cc0c..562959dff6 100644 --- a/samples/depthtesting.cpp +++ b/samples/depthtesting.cpp @@ -27,8 +27,8 @@ #include -#include "../samples/app/Config.h" -#include "../samples/app/FilamentApp.h" +#include "filamentapp/Config.h" +#include "filamentapp/FilamentApp.h" #include diff --git a/samples/frame_generator.cpp b/samples/frame_generator.cpp index 664c0f6807..94224ac258 100644 --- a/samples/frame_generator.cpp +++ b/samples/frame_generator.cpp @@ -51,10 +51,10 @@ #include #include -#include "app/Config.h" -#include "app/IBL.h" -#include "app/FilamentApp.h" -#include "app/MeshAssimp.h" +#include "filamentapp/Config.h" +#include "filamentapp/IBL.h" +#include "filamentapp/FilamentApp.h" +#include "filamentapp/MeshAssimp.h" using namespace filament::math; using namespace filament; diff --git a/samples/gltf_viewer.cpp b/samples/gltf_viewer.cpp index 0b3a317d36..eecce7b880 100644 --- a/samples/gltf_viewer.cpp +++ b/samples/gltf_viewer.cpp @@ -16,9 +16,9 @@ #define GLTFIO_SIMPLEVIEWER_IMPLEMENTATION -#include "app/Config.h" -#include "app/FilamentApp.h" -#include "app/IBL.h" +#include "filamentapp/Config.h" +#include "filamentapp/FilamentApp.h" +#include "filamentapp/IBL.h" #include #include diff --git a/samples/heightfield.cpp b/samples/heightfield.cpp index a016973508..c7b1d20af3 100644 --- a/samples/heightfield.cpp +++ b/samples/heightfield.cpp @@ -33,7 +33,7 @@ #include -#include "app/FilamentApp.h" +#include "filamentapp/FilamentApp.h" #define STB_PERLIN_IMPLEMENTATION #include diff --git a/samples/hellopbr.cpp b/samples/hellopbr.cpp index 9ca75e39c4..0a4b5918f8 100644 --- a/samples/hellopbr.cpp +++ b/samples/hellopbr.cpp @@ -26,8 +26,8 @@ #include -#include "app/Config.h" -#include "app/FilamentApp.h" +#include "filamentapp/Config.h" +#include "filamentapp/FilamentApp.h" #include "generated/resources/resources.h" diff --git a/samples/hellotriangle.cpp b/samples/hellotriangle.cpp index f57f0d8833..946f15efa1 100644 --- a/samples/hellotriangle.cpp +++ b/samples/hellotriangle.cpp @@ -27,8 +27,8 @@ #include -#include "../samples/app/Config.h" -#include "../samples/app/FilamentApp.h" +#include "filamentapp/Config.h" +#include "filamentapp/FilamentApp.h" #include diff --git a/samples/lightbulb.cpp b/samples/lightbulb.cpp index 1b8ecdb393..6734149306 100644 --- a/samples/lightbulb.cpp +++ b/samples/lightbulb.cpp @@ -37,12 +37,12 @@ #include #include -#include "app/Config.h" -#include "app/FilamentApp.h" -#include "app/MeshAssimp.h" -#include "app/Cube.h" -#include "app/IcoSphere.h" -#include "app/Sphere.h" +#include "filamentapp/Config.h" +#include "filamentapp/FilamentApp.h" +#include "filamentapp/MeshAssimp.h" +#include "filamentapp/Cube.h" +#include "filamentapp/IcoSphere.h" +#include "filamentapp/Sphere.h" #include "generated/resources/resources.h" diff --git a/samples/lucy_utils.cpp b/samples/lucy_utils.cpp deleted file mode 100644 index 4c421c4cd1..0000000000 --- a/samples/lucy_utils.cpp +++ /dev/null @@ -1,406 +0,0 @@ -/* - * Copyright (C) 2019 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. - */ - -#include "lucy_utils.h" - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include - -#include - -using namespace filament; -using namespace filament::math; -using namespace utils; - -using filament::geometry::SurfaceOrientation; - -#define FILTER_SIZE 17 -#define SAMPLE_COUNT (1 + FILTER_SIZE / 2) - -namespace LucyUtils { - -constexpr float M_PIf = float(M_PI); - -Entity createQuad(Engine* engine, Texture* tex, ImageOp op, Texture* secondary) { - - static VertexBuffer* vertexBuffer = [](Engine& engine) { - struct OverlayVertex { - float2 position; - float2 uv; - }; - static OverlayVertex verts[4] = { - {{0, 0}, {0, 0} }, - {{1, 0}, {1, 0} }, - {{0, 1}, {0, 1} }, - {{1, 1}, {1, 1} } - }; - auto vb = VertexBuffer::Builder() - .vertexCount(4) - .bufferCount(1) - .attribute(VertexAttribute::POSITION, 0, VertexBuffer::AttributeType::FLOAT2, 0, 16) - .attribute(VertexAttribute::UV0, 0, VertexBuffer::AttributeType::FLOAT2, 8, 16) - .build(engine); - vb->setBufferAt(engine, 0, VertexBuffer::BufferDescriptor(verts, sizeof(verts), nullptr)); - return vb; - }(*engine); - - static IndexBuffer* indexBuffer = [](Engine& engine) { - static constexpr uint16_t indices[6] = { 2, 1, 0, 1, 2, 3 }; - auto ib = IndexBuffer::Builder() - .indexCount(6) - .bufferType(IndexBuffer::IndexType::USHORT) - .build(engine); - ib->setBuffer(engine, IndexBuffer::BufferDescriptor(indices, sizeof(indices), nullptr)); - return ib; - }(*engine); - - static Material* blit = [](Engine& engine) { - filamat::Package pkg = filamat::MaterialBuilder() - .name("blit") - .material(R"SHADER( - void material(inout MaterialInputs material) { - prepareMaterial(material); - vec2 uv = uvToRenderTargetUV(getUV0()); - material.baseColor = texture(materialParams_color, uv); - } - )SHADER") - .require(VertexAttribute::UV0) - .parameter(filamat::MaterialBuilder::SamplerType::SAMPLER_2D, "color") - .targetApi(filamat::targetApiFromBackend(engine.getBackend())) - .shading(Shading::UNLIT) - .depthWrite(false) - .depthCulling(false) - .build(); - return Material::Builder().package(pkg.getData(), pkg.getSize()).build(engine); - }(*engine); - - static Material* mix = [](Engine& engine) { - filamat::Package pkg = filamat::MaterialBuilder() - .name("mix") - .material(R"SHADER( - void material(inout MaterialInputs material) { - prepareMaterial(material); - vec2 uv = uvToRenderTargetUV(getUV0()); - vec4 primary = texture(materialParams_color, uv); - vec4 blurred = texture(materialParams_secondary, uv); - // HACK: this is a crude bloom effect - float L = max(0.0, max(blurred.r, max(blurred.g, blurred.b)) - 1.0); - material.baseColor = mix(primary, blurred, min(1.0, L)); - } - )SHADER") - .require(VertexAttribute::UV0) - .parameter(filamat::MaterialBuilder::SamplerType::SAMPLER_2D, "color") - .parameter(filamat::MaterialBuilder::SamplerType::SAMPLER_2D, "secondary") - .targetApi(filamat::targetApiFromBackend(engine.getBackend())) - .shading(Shading::UNLIT) - .depthWrite(false) - .depthCulling(false) - .build(); - return Material::Builder().package(pkg.getData(), pkg.getSize()).build(engine); - }(*engine); - - // Compute the "weights" array, which is composed of two consective sequences of 4-tuples: - // [WEIGHT, OFFSET_X, OFFSET_Y, DONT_CARE] - // The first sequence is for the horizontal pass, the second sequence is for the vertical pass. - static const float4* weights = []() { - static float4 weights[SAMPLE_COUNT * 2]; - float4* hweights = weights; - float4* vweights = weights + SAMPLE_COUNT; - const auto filter = [](float t) { - t /= 2.0; - if (t >= 1.0) return 0.0f; - const float scale = 1.0f / std::sqrt(0.5f * M_PIf); - return std::exp(-2.0f * t * t) * scale; - }; - constexpr float pixelWidth = 2.0f / float(FILTER_SIZE); - float sum = 0.0f; - for (int s = 0; s < SAMPLE_COUNT; s++) { - - // Determine which two texels to sample from. - int i, j; - if (s < SAMPLE_COUNT / 2) { - i = s * 2; - j = i + 1; - } else if (s == SAMPLE_COUNT / 2) { - i = j = s * 2; - } else { - j = s * 2; - i = j - 1; - } - - // Determine the normalized (x,y) along the Gaussian curve for each of the two samples. - float weighti = filter(std::abs(-1.0f + pixelWidth / 2.0f + pixelWidth * i)); - float weightj = filter(std::abs(-1.0f + pixelWidth / 2.0f + pixelWidth * j)); - float offseti = i - (FILTER_SIZE - 1) / 2; - - // Leverage hardware interpolation by sampling between the texel centers. - // Nudge the left sample rightward by an amount proportional to its weight. - const float offset = offseti + weightj / (weighti + weightj); - const float weight = weighti + weightj; - - hweights[s].x = vweights[s].x = weight; - hweights[s].y = vweights[s].z = offset; - hweights[s].z = vweights[s].y = 0.0f; - sum += weights[s].x; - } - for (int s = 0; s < SAMPLE_COUNT; s++) { - hweights[s].x /= sum; - vweights[s].x /= sum; - } - return weights; - }(); - static const float4* hweights = weights; - static const float4* vweights = weights + SAMPLE_COUNT; - - static Material* blur = [](Engine& engine) { - std::string txt = R"SHADER( - void material(inout MaterialInputs material) { - prepareMaterial(material); - float2 uv = uvToRenderTargetUV(getUV0()); - vec4 c = vec4(0); - for (int i = 0; i < SAMPLE_COUNT; i++) { - float2 st = uv + materialParams.weights[i].yz * getResolution().zw; - c += texture(materialParams_color, st) * materialParams.weights[i].x; - } - material.baseColor = c; - } - )SHADER"; - const std::string from("SAMPLE_COUNT"); - const std::string to = std::to_string(SAMPLE_COUNT); - size_t pos = txt.find(from); - txt.replace(pos, from.length(), to.c_str()); - filamat::Package pkg = filamat::MaterialBuilder() - .name("blur") - .material(txt.c_str()) - .require(VertexAttribute::UV0) - .parameter(filamat::MaterialBuilder::SamplerType::SAMPLER_2D, "color") - .parameter(filamat::MaterialBuilder::UniformType::FLOAT4, SAMPLE_COUNT, "weights") - .targetApi(filamat::targetApiFromBackend(engine.getBackend())) - .shading(Shading::UNLIT) - .depthWrite(false) - .depthCulling(false) - .build(); - return Material::Builder().package(pkg.getData(), pkg.getSize()).build(engine); - }(*engine); - - TextureSampler::MinFilter minFilter = TextureSampler::MinFilter::LINEAR; - TextureSampler::MagFilter magFilter = TextureSampler::MagFilter::LINEAR; - TextureSampler sampler(minFilter, magFilter); - - MaterialInstance* matInstance; - switch (op) { - case BLIT: - matInstance = blit->createInstance(); - break; - case HBLUR: - matInstance = blur->createInstance(); - matInstance->setParameter("weights", hweights, SAMPLE_COUNT); - break; - case VBLUR: - matInstance = blur->createInstance(); - matInstance->setParameter("weights", vweights, SAMPLE_COUNT); - break; - case MIX: - matInstance = mix->createInstance(); - matInstance->setParameter("secondary", secondary, sampler); - break; - } - matInstance->setParameter("color", tex, sampler); - - Entity entity = EntityManager::get().create(); - RenderableManager::Builder(1) - .boundingBox({{ 0, 0, 0 }, { 9000, 9000, 9000 }}) - .material(0, matInstance) - .geometry(0, RenderableManager::PrimitiveType::TRIANGLES, vertexBuffer, indexBuffer) - .build(*engine, entity); - - return entity; -} - -Entity createDisk(Engine* engine, Texture* reflection) { - constexpr int nslices = 64; - constexpr int nverts = nslices + 2; - - static float4 verts[nverts]; - int slice = 0; - while (slice < nslices + 1) { - float theta = 2.0f * M_PI * slice / nslices; - verts[slice++] = float4 { - std::cos(theta), std::sin(theta), - 0.5 + 0.5 * std::cos(theta), 0.5 + 0.5 * std::sin(theta) - }; - } - verts[slice] = {0.0f, 0.0f, 0.5f, 0.5f}; - - static quath quats[nverts]; - static float3 normals[1] = { float3(0, 0, 1) }; - auto* helper = SurfaceOrientation::Builder().vertexCount(1).normals(normals).build(); - helper->getQuats(quats, 1); - delete helper; - for (int i = 1; i < nverts; i++) { - quats[i] = quats[0]; - } - - static uint16_t indices[nslices * 3]; - for (int slice = 0, j = 0; slice < nslices; ++slice) { - indices[j++] = nverts - 1; - indices[j++] = slice; - indices[j++] = (slice + 1) % (nslices + 1); - } - - VertexBuffer* vbuffer = VertexBuffer::Builder() - .vertexCount(nverts) - .bufferCount(2) - .attribute(VertexAttribute::POSITION, 0, VertexBuffer::AttributeType::FLOAT2, 0, 16) - .attribute(VertexAttribute::UV0, 0, VertexBuffer::AttributeType::FLOAT2, 8, 16) - .attribute(VertexAttribute::TANGENTS, 1, VertexBuffer::AttributeType::HALF4) - .build(*engine); - - vbuffer->setBufferAt(*engine, 0, VertexBuffer::BufferDescriptor(verts, sizeof(verts), nullptr)); - vbuffer->setBufferAt(*engine, 1, VertexBuffer::BufferDescriptor(quats, sizeof(quats), nullptr)); - - IndexBuffer* ibuffer = IndexBuffer::Builder() - .indexCount(nslices * 3) - .bufferType(IndexBuffer::IndexType::USHORT) - .build(*engine); - - ibuffer->setBuffer(*engine, IndexBuffer::BufferDescriptor(indices, sizeof(indices), nullptr)); - - filamat::Package pkg = filamat::MaterialBuilder() - .name("podium") - .material(R"SHADER( - void material(inout MaterialInputs material) { - vec3 n = texture(materialParams_normal, getUV0()).xyz * 2.0 - 1.0; - - // The blue tiles normal map is very harsh, so we soften the normal vector. - material.normal = normalize(n + vec3(0, 0, 5)); - - prepareMaterial(material); - material.baseColor = texture(materialParams_color, getUV0()); - material.roughness = texture(materialParams_roughness, getUV0()).r; - material.ambientOcclusion = texture(materialParams_ao, getUV0()).r; - - float2 uv = gl_FragCoord.xy * getResolution().zw; uv.y = 1.0 - uv.y; - vec3 reflection = texture(materialParams_reflection, uv).xyz; - - // HACK: blend the reflection with the baseColor. - material.baseColor.rgb = mix(reflection, material.baseColor.rgb, 0.75); - } - )SHADER") - .require(VertexAttribute::UV0) - .parameter(filamat::MaterialBuilder::SamplerType::SAMPLER_2D, "normal") - .parameter(filamat::MaterialBuilder::SamplerType::SAMPLER_2D, "color") - .parameter(filamat::MaterialBuilder::SamplerType::SAMPLER_2D, "roughness") - .parameter(filamat::MaterialBuilder::SamplerType::SAMPLER_2D, "ao") - .parameter(filamat::MaterialBuilder::SamplerType::SAMPLER_2D, "reflection") - .targetApi(filamat::targetApiFromBackend(engine->getBackend())) - .specularAntiAliasing(true) - .shading(Shading::LIT) - .build(); - - Material* material = Material::Builder().package(pkg.getData(), pkg.getSize()).build(*engine); - MaterialInstance* matInstance = material->createInstance(); - - auto createTexture4 = [engine](const uint8_t* data, int size, bool srgb) { - int width, height, nchan; - auto texels = stbi_load_from_memory(data, size, &width, &height, &nchan, 4); - Texture::PixelBufferDescriptor buffer(texels, size_t(width * height * 4), - Texture::Format::RGBA, Texture::Type::UBYTE, - (Texture::PixelBufferDescriptor::Callback) &stbi_image_free); - auto tex = Texture::Builder() - .width(uint32_t(width)).height(uint32_t(height)).levels(1) - .sampler(Texture::Sampler::SAMPLER_2D) - .format(srgb ? Texture::InternalFormat::SRGB8_A8 : Texture::InternalFormat::RGBA8) - .build(*engine); - tex->setImage(*engine, 0, std::move(buffer)); - tex->generateMipmaps(*engine); - return tex; - }; - - auto createTexture1 = [engine](const uint8_t* data, int size) { - int width, height, nchan; - auto texels = stbi_load_from_memory(data, size, &width, &height, &nchan, 1); - Texture::PixelBufferDescriptor buffer(texels, size_t(width * height), - Texture::Format::R, Texture::Type::UBYTE, - (Texture::PixelBufferDescriptor::Callback) &stbi_image_free); - auto tex = Texture::Builder() - .width(uint32_t(width)).height(uint32_t(height)).levels(1) - .sampler(Texture::Sampler::SAMPLER_2D) - .format(Texture::InternalFormat::R8) - .build(*engine); - tex->setImage(*engine, 0, std::move(buffer)); - tex->generateMipmaps(*engine); - return tex; - }; - - auto normal = createTexture4(RESOURCE_ARGS(BLUE_TILES_01_NORMAL), false); - auto color = createTexture4(RESOURCE_ARGS(BLUE_TILES_01_COLOR), true); - auto roughness = createTexture1(RESOURCE_ARGS(BLUE_TILES_01_ROUGHNESS)); - auto occlusion = createTexture1(RESOURCE_ARGS(BLUE_TILES_01_AO)); - - TextureSampler sampler(TextureSampler::MinFilter::LINEAR_MIPMAP_LINEAR, - TextureSampler::MagFilter::LINEAR); - - matInstance->setParameter("normal", normal, sampler); - matInstance->setParameter("color", color, sampler); - matInstance->setParameter("roughness", roughness, sampler); - matInstance->setParameter("ao", occlusion, sampler); - matInstance->setParameter("reflection", reflection, - TextureSampler(TextureSampler::MagFilter::LINEAR)); - - auto entity = EntityManager::get().create(); - RenderableManager::Builder(1) - .boundingBox({{ -1, -1, 1 }, { 1, 1, 1 }}) - .material(0, matInstance) - .geometry(0, RenderableManager::PrimitiveType::TRIANGLES, vbuffer, ibuffer) - .culling(false) - .receiveShadows(true) - .castShadows(false) - .build(*engine, entity); - - auto& tcm = engine->getTransformManager(); - tcm.create(entity); - - return entity; -} - -mat4f fitIntoUnitCube(const Aabb& bounds) { - auto minPoint = bounds.min; - auto maxPoint = bounds.max; - float maxExtent = 0; - maxExtent = std::max(maxPoint.x - minPoint.x, maxPoint.y - minPoint.y); - maxExtent = std::max(maxExtent, maxPoint.z - minPoint.z); - float scaleFactor = 2.0f / maxExtent; - float3 center = (minPoint + maxPoint) / 2.0f; - return mat4f::scaling(float3(scaleFactor)) * mat4f::translation(-center); -} - -} // namespace LucyUtils diff --git a/samples/lucy_utils.h b/samples/lucy_utils.h deleted file mode 100644 index a29bfdc0be..0000000000 --- a/samples/lucy_utils.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2019 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. - */ - -#ifndef TNT_FILAMENT_SAMPLES_LUCY_UTILS_H -#define TNT_FILAMENT_SAMPLES_LUCY_UTILS_H - -#include -#include -#include - -#include - -#include "generated/resources/gltf_lucy.h" - -#define RESOURCE_ARGS(name) GLTF_LUCY_##name##_DATA, GLTF_LUCY_##name##_SIZE - -namespace LucyUtils { - enum ImageOp { BLIT, HBLUR, VBLUR, MIX }; - utils::Entity createQuad(filament::Engine* engine, filament::Texture* tex, ImageOp op, - filament::Texture* secondary = nullptr); - utils::Entity createDisk(filament::Engine* engine, filament::Texture* reflection); - filament::math::mat4f fitIntoUnitCube(const filament::Aabb& bounds); -} - -#endif // #define TNT_FILAMENT_SAMPLES_LUCY_UTILS_H diff --git a/samples/material_sandbox.cpp b/samples/material_sandbox.cpp index 334e0c59fa..d99ec48fa1 100644 --- a/samples/material_sandbox.cpp +++ b/samples/material_sandbox.cpp @@ -44,10 +44,10 @@ #include #include -#include "app/Config.h" -#include "app/IBL.h" -#include "app/FilamentApp.h" -#include "app/MeshAssimp.h" +#include "filamentapp/Config.h" +#include "filamentapp/IBL.h" +#include "filamentapp/FilamentApp.h" +#include "filamentapp/MeshAssimp.h" #include "material_sandbox.h" diff --git a/samples/point_sprites.cpp b/samples/point_sprites.cpp index a86ebfec6b..cee63446b9 100644 --- a/samples/point_sprites.cpp +++ b/samples/point_sprites.cpp @@ -31,8 +31,8 @@ #include #include -#include "../samples/app/Config.h" -#include "../samples/app/FilamentApp.h" +#include "filamentapp/Config.h" +#include "filamentapp/FilamentApp.h" #include diff --git a/samples/sample_cloth.cpp b/samples/sample_cloth.cpp index a7c6196601..7a0aa7c413 100644 --- a/samples/sample_cloth.cpp +++ b/samples/sample_cloth.cpp @@ -37,8 +37,8 @@ #include #include -#include "app/Config.h" -#include "app/FilamentApp.h" +#include "filamentapp/Config.h" +#include "filamentapp/FilamentApp.h" #include diff --git a/samples/sample_full_pbr.cpp b/samples/sample_full_pbr.cpp index d972825a17..c0a63018cc 100644 --- a/samples/sample_full_pbr.cpp +++ b/samples/sample_full_pbr.cpp @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "app/Config.h" -#include "app/FilamentApp.h" -#include "app/MeshAssimp.h" +#include "filamentapp/Config.h" +#include "filamentapp/FilamentApp.h" +#include "filamentapp/MeshAssimp.h" #include #include diff --git a/samples/sample_normal_map.cpp b/samples/sample_normal_map.cpp index 76c664290f..1cef59fc74 100644 --- a/samples/sample_normal_map.cpp +++ b/samples/sample_normal_map.cpp @@ -37,8 +37,8 @@ #include #include -#include "app/Config.h" -#include "app/FilamentApp.h" +#include "filamentapp/Config.h" +#include "filamentapp/FilamentApp.h" #include #include diff --git a/samples/shadowtest.cpp b/samples/shadowtest.cpp index 7f50397cda..b6d0e041c2 100644 --- a/samples/shadowtest.cpp +++ b/samples/shadowtest.cpp @@ -28,9 +28,9 @@ #include -#include "../samples/app/Config.h" -#include "../samples/app/FilamentApp.h" -#include "../samples/app/MeshAssimp.h" +#include "filamentapp/Config.h" +#include "filamentapp/FilamentApp.h" +#include "filamentapp/MeshAssimp.h" #include "generated/resources/resources.h" diff --git a/samples/strobecolor.cpp b/samples/strobecolor.cpp index cf28ed6572..38a7e19441 100644 --- a/samples/strobecolor.cpp +++ b/samples/strobecolor.cpp @@ -18,8 +18,8 @@ #include #include -#include "../samples/app/Config.h" -#include "../samples/app/FilamentApp.h" +#include "filamentapp/Config.h" +#include "filamentapp/FilamentApp.h" #include diff --git a/samples/suzanne.cpp b/samples/suzanne.cpp index 9ba52058ba..4d0be5a3cc 100644 --- a/samples/suzanne.cpp +++ b/samples/suzanne.cpp @@ -31,9 +31,9 @@ #include #include -#include "app/Config.h" -#include "app/FilamentApp.h" -#include "app/IBL.h" +#include "filamentapp/Config.h" +#include "filamentapp/FilamentApp.h" +#include "filamentapp/IBL.h" #include diff --git a/samples/texturedquad.cpp b/samples/texturedquad.cpp index 3b3ef6112d..c510d5c783 100644 --- a/samples/texturedquad.cpp +++ b/samples/texturedquad.cpp @@ -30,8 +30,8 @@ #include -#include "../samples/app/Config.h" -#include "../samples/app/FilamentApp.h" +#include "filamentapp/Config.h" +#include "filamentapp/FilamentApp.h" #include diff --git a/samples/vbotest.cpp b/samples/vbotest.cpp index 23db5d27fc..7ab2b18ea5 100644 --- a/samples/vbotest.cpp +++ b/samples/vbotest.cpp @@ -21,7 +21,7 @@ #include #include -#include "../samples/app/FilamentApp.h" +#include "filamentapp/FilamentApp.h" #include diff --git a/samples/viewtest.cpp b/samples/viewtest.cpp index 68a21aca5a..c2d63fce08 100644 --- a/samples/viewtest.cpp +++ b/samples/viewtest.cpp @@ -20,7 +20,7 @@ #include #include -#include "../samples/app/FilamentApp.h" +#include "filamentapp/FilamentApp.h" #include