Skip to content

Commit

Permalink
[Emscripten, GLTFViewer]: Removed larger assets for Web page (close #200
Browse files Browse the repository at this point in the history
)
  • Loading branch information
MikhailGorobets committed Aug 26, 2024
1 parent 7eaad11 commit 8bf7f10
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
14 changes: 13 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,19 @@ function(add_sample_app APP_NAME IDE_FOLDER SOURCE INCLUDE SHADERS ASSETS)

if(PLATFORM_EMSCRIPTEN)
set(RESOURCE_PATH "${PROJECT_SOURCE_DIR}/assets/")
target_link_options(${APP_NAME} PRIVATE "SHELL: -s ALLOW_MEMORY_GROWTH=1 --preload-file '${RESOURCE_PATH}@'")
target_link_options(${APP_NAME} PRIVATE "SHELL: -s ALLOW_MEMORY_GROWTH=1 --preload-file ${RESOURCE_PATH}@")

if (${APP_NAME} STREQUAL "GLTFViewer")
set(EXCLUDE_DIRECTORIES
".git"
"BarbieDodgePickup"
"IridescentDishWithOlives"
)

foreach(EXCLUDE_DIR IN LISTS EXCLUDE_DIRECTORIES)
target_link_options(${APP_NAME} PRIVATE "SHELL: --exclude-file=${PROJECT_SOURCE_DIR}/assets/models/${EXCLUDE_DIR}")
endforeach()
endif()
append_sample_base_emscripten_source(${APP_NAME})
endif()

Expand Down
4 changes: 4 additions & 0 deletions Samples/GLTFViewer/src/GLTFViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,18 @@ SampleBase* CreateSample()
const std::pair<const char*, const char*> DefaultGLTFModels[] =
{
{"Damaged Helmet", "models/DamagedHelmet/DamagedHelmet.gltf"},
#if !PLATFORM_EMSCRIPTEN
{"Barbie Dodge Pickup", "models/BarbieDodgePickup/scene.gltf"},
#endif
{"Flight Helmet", "models/FlightHelmet/glTF/FlightHelmet.gltf"},
{"Cesium Man", "models/CesiumMan/glTF/CesiumMan.gltf"},
{"Boom Box", "models/BoomBoxWithAxes/glTF/BoomBoxWithAxes.gltf"},
{"Clearcoat Ring", "models/ClearcoatRing/glTF/ClearcoatRing.gltf"},
{"Glam Velvet Sofa", "models/GlamVelvetSofa/glTF/GlamVelvetSofa.gltf"},
{"Iridescence Abalone", "models/IridescenceAbalone/glTF/IridescenceAbalone.gltf"},
#if !PLATFORM_EMSCRIPTEN
{"Iridescent Dish With Olives", "models/IridescentDishWithOlives/glTF/IridescentDishWithOlives.gltf"},
#endif
{"Toy Car", "models/ToyCar/glTF/ToyCar.gltf"},
{"Anisotropy Barn Lamp", "models/AnisotropyBarnLamp/glTF/AnisotropyBarnLamp.gltf"},
{"White Furnace Test", "models/EnvironmentTest/glTF/EnvironmentTest.gltf"},
Expand Down

0 comments on commit 8bf7f10

Please sign in to comment.