Getting Started

Downloading the Engine

The engine source code is hosted on GitHub (https://github.com/diligentgraphics). Every module is kept in its own repository:

Every module can be downloaded independently. Alternatively, there is a master repository that includes all three as submodules: https://github.com/DiligentGraphics/DiligentEngine.

Building the Engine

Diligent Engine uses CMake as a cross-platform build tool. To start using CMake, download the latest release (3.14 or later is required for Windows build).

Win32

To generate build files for Windows desktop platform, use either CMake GUI or command line tool. For example, to generate Visual Studio 2017 64-bit solution and project files in build/Win64 folder, navigate to the engine’s root folder and run the following command:

cmake -S . -B ./build/Win64 -G “Visual Studio 15 2017 Win64”

WARNING! In current implementation, full path to cmake build folder must not contain white spaces.

Open DiligentEngine.sln file in build folder, select the desired configuration and build the engine. By default, Asteroids demo will be set up as startup project.

Universal Windows Platform

Since the tragic Apollo 1 launch pad fire in 1967 that killed astronauts Virgil “Gus” Grissom, Roger Chaffee and Ed White, the patches have been silk screened onto flame-retardant cloth instead of embroidered. commander cialis check out over here This is beneficial both for the patient as well as doctor. probe viagra But through proper treatments, this sexual problem too can be one of those happy men and become the active partner with enough ability discount viagra for penetration. How does kamagra work? Effective and cheap Kamagra is prepared with sale viagra an active ingredient well-known as ‘sildenafil citrate’.

To generate build files for Universal Windows platform, you need to define the following two cmake variables:

  • CMAKE_SYSTEM_NAME=WindowsStore
  • CMAKE_SYSTEM_VERSION=<Windows SDK Version>

For example, to generate Visual Studio 2017 64-bit solution and project files in build/UWP64 folder, run the following command from the engine’s root folder:

cmake -D CMAKE_SYSTEM_NAME=WindowsStore -D CMAKE_SYSTEM_VERSION=10.0.15063.0 -S . -B ./build/UWP64 -G “Visual Studio 15 2017 Win64”

Android

Please make sure that your machine is set up for Android development. Download Android Studio, Android NDK and other required tools. To verify that your environment is properly set up, try building teapots sample.

Open DiligentSamples/Android or UnityPlugin/Android folders with Android Studio to build and run the engine samples and Unity emulator on Android.

Linux

Your Linux environment needs to be set up for c++ development. To configure my fresh Ubuntu 17.10, I installed the following packages:

gcc, make and other essential c/c++ tools:

  • sudo apt-get update
  • sudo apt-get upgrade
  • sudo apt-get install build-essential

cmake

  • sudo apt-get install cmake

Other required packages:

  • sudo apt-get install libx11-dev
  • sudo apt-get install mesa-common-dev
  • sudo apt-get install mesa-utils
  • sudo apt-get install libgl-dev

To generate make files for debug configuration, run the following CMake command from the engine’s root folder:

cmake -S . -B ./build/Linux64 -G “Unix Makefiles” -DCMAKE_BUILD_TYPE=”Debug”

To build the engine, run the following command:

cmake –build ./build/Linux64

MacOS

After you clone the repo, run the following command from the engine’s root folder to generate XCode project (you need to have CMake installed on the system):

cmake -S . -B ./build/MacOS -G “Xcode”

The project will be located in build/MacOS folder.

Configuring Vulkan Build Environment

By default there is no Vulkan implementation on MacOS. Diligent Engine links against Vulkan loader and can use a Vulkan Portability implementation such as MoltenVK or gfx-portability. Install VulkanSDK and make sure that your system is properly configured as described here. In particular, you may need to define the following environment variables (assuming that Vulkan SDK is installed at ~/LunarG/vulkansdk-macos and you want to use MoltenVK):

export VULKAN_SDK=~/LunarG/vulkansdk-macos/macOS
export PATH=$VULKAN_SDK/bin:$PATH
export DYLD_LIBRARY_PATH=$VULKAN_SDK/lib:$DYLD_LIBRARY_PATH
export VK_ICD_FILENAMES=$VULKAN_SDK/etc/vulkan/icd.d/MoltenVK_icd.json
export VK_LAYER_PATH=$VULKAN_SDK/etc/vulkan/explicit_layer.d

Note that environment variables set in the shell are not seen by the applications launched from Launchpad or other desktop GUI. Thus to make sure that an application finds Vulkan libraries, it needs to be started from the command line. Due to the same reason, the xcode project file should also be opened from the shell using open command. With Xcode versions 7 and later, this behavior may need to be enabled first using the following command:

defaults write com.apple.dt.Xcode UseSanitizedBuildSystemEnvironment -bool NO
Please refer to this page for more details.

iOS

Run the command below from the engine’s root folder to generate Xcode project configured for iOS build (you need to have CMake installed on your Mac):

cmake -DCMAKE_TOOLCHAIN_FILE=DiligentCore/ios.toolchain.cmake -S . -B ./build/IOS -GXcode

Open Xcode project file in build/IOS folder and build the engine. To run the applications on an iOS device, you will need to set the appropriate development team in the project settings.

Configuring Vulkan Build Environment

To enable Vulkan on iOS, download and install VulkanSDK. There is no Vulkan loader on iOS, and Diligent Engine links directly with MoltenVK dynamic library that implements Vulkan on Metal. Note that iOS simulator does not currently support Metal, and MoltenVK libraries are only available for arm64 architecture. To enable Vulkan in Diligent Engine on iOS, specify the path to Vulkan SDK when running CMake, for example (assuming that Vulkan SDK is installed at /LunarG/vulkansdk-macos):

cmake -DCMAKE_TOOLCHAIN_FILE=DiligentCore/ios.toolchain.cmake -DIOS_PLATFORM=OS64 -DIOS_ARCH=arm64 -DVULKAN_SDK=/LunarG/vulkansdk-macos -S . -B ./build/IOS -GXcode

Xcode project cannot be completely configured by CMake. For every executable target, the following manual steps have to be performed:

  • Open Build Phases tab and add a new Copy Files phase.
  • Select Executables in the Destination list.
  • Drag MoltenVK/iOS/dynamic/libMoltenVK.dylib dynamic library from Vulkan SDK into the copy files list.
  • Make sure that Code Sign On Copy checkbox is marked.

Please refer to MoltenVK user guide for more details.

Engine Structure

The engine consists of the following logical modules:

  • Core module is the collection of libraries and platform utilities that provide all the key functionality. The module contains the following projects:
    • Primitives (Graphics/Primitives) contains definitions of basic types (Int32, Int16, Uint32, etc.) and interfaces (IObject, IReferenceCounters, etc.)
    • Common (Graphics/Common) implements common functionality such as file wrapper, logging, debug utilities, etc.
    • GraphicsAccessories (Graphics/GraphicsAccessories) contains basic graphics accessories used by all implementations
    • GraphicsEngine (Graphics/GraphicsEngine) provides platform-independent base functionality
    • GraphicsEngineD3DBase (Graphics/GraphicsEngineD3DBase) provides base functionality for D3D11/D3D12 implementations
    • GraphicsEngineD3D11 (Graphics/GraphicsEngineD3D11) is the engine implementation with Direct3D11
    • GraphicsEngineD3D12 (Graphics/GraphicsEngineD3D12) is the engine implementation with Direct3D12
    • GraphicsEngineOpenGL (Graphics/GraphicsEngineOpenGL) is the engine implementation with OpenGL/OpenGLES
    • GraphicsEngineVulkan (Graphics/GraphicsEngineVulkan) is the engine implementation with Vulkan
    • GraphicsTools (Graphics/GraphicsTools) provides graphics utilities build on top of core interfaces (definitions of commonly used states, texture uploaders, etc.)
    • BasicPlatform (Platforms/BasicPlatform) defines interface for platform-specific routines and implements some common functionality
    • AndroidPlatform (Platforms/Android) implements platform-specific routines on Android
    • Win32Platform (Platforms/Win32) implements platform-specific routines on Win32 desktop
    • UniversalWindowsPlatform (Platforms/UWP) implements platform-specific routines on Universal Windows Platform
    • LinuxPlatform (Platforms/Linux) implementation of platform-specific routines on Linux platform
    • ApplePlatform (Platforms/Apple) implementation of platform-specific routines on Apple platforms (MacOS, iOS)
  • Tools module implements additional utilities on top of the core library:
    • TextureLoader provides texture and image loading routines.
    • Asset Loader, an asset loading libary. The library currently supports GLTF 2.0.
    • Imgui: implementation of dear imgui with Diligent API.
    • NativeApp: implementation of native application on supported platforms.
  • Samples module contains simple applications that demonstrate the usage of the engine:
  • Master repository also contains the following projects:
    • AsteroidsDemo, a performance benchmark that is based on this demo developed by Intel and renders 50,000 unique textured asteroids
    • UnityPlugin, a simple project that demonstrates integration of Diligent Engine with Unity