@@ -314,6 +314,12 @@ set(MATERIAL_FL0_SRCS
314314 src/materials/skybox.mat
315315)
316316
317+ set (MATERIAL_MULTIVIEW_SRCS
318+ src/materials/clearDepth.mat
319+ src/materials/defaultMaterial.mat
320+ src/materials/skybox.mat
321+ )
322+
317323# ==================================================================================================
318324# Configuration
319325# ==================================================================================================
@@ -338,6 +344,11 @@ if (FILAMENT_ENABLE_FEATURE_LEVEL_0)
338344 add_definitions (-DFILAMENT_ENABLE_FEATURE_LEVEL_0)
339345endif ()
340346
347+ # Whether to include MULTIVIEW materials.
348+ if (FILAMENT_ENABLE_MULTIVIEW)
349+ add_definitions (-DFILAMENT_ENABLE_MULTIVIEW)
350+ endif ()
351+
341352# Whether to force the profiling mode.
342353if (FILAMENT_FORCE_PROFILING_MODE)
343354 add_definitions (-DFILAMENT_FORCE_PROFILING_MODE)
@@ -428,6 +439,21 @@ foreach(mat_dir ${MATERIAL_DIRS})
428439 list (APPEND FILAMAT_FILES_FOR_GROUP ${output_path_fl0} )
429440 list (APPEND FILAMAT_TARGETS_FOR_GROUP ${output_path_fl0} )
430441 endif ()
442+
443+ # --- Multiview variant ---
444+ list (FIND MATERIAL_MULTIVIEW_SRCS ${mat_src} index)
445+ if (${index} GREATER -1 AND FILAMENT_ENABLE_MULTIVIEW)
446+ string (REGEX REPLACE "[.]filamat$" "_multiview.filamat" output_path_multiview ${output_path} )
447+ add_custom_command (
448+ OUTPUT ${output_path_multiview}
449+ COMMAND matc ${MATC_BASE_FLAGS} -PstereoscopicType=multiview -o ${output_path_multiview} ${fullname}
450+ MAIN_DEPENDENCY ${fullname}
451+ DEPENDS matc
452+ COMMENT "Compiling material ${fullname} (Multiview)"
453+ )
454+ list (APPEND FILAMAT_FILES_FOR_GROUP ${output_path_multiview} )
455+ list (APPEND FILAMAT_TARGETS_FOR_GROUP ${output_path_multiview} )
456+ endif ()
431457 endforeach ()
432458
433459 # Generate a single resource file for the whole group
0 commit comments