Samples and Tutorials

Tutorials are simple graphics applications intended to demonstrate the usage of the Diligent Engine API. The samples’ source files are hosted in DiligentSamples repository (https://github.com/DiligentGraphics/DiligentSamples). The following tutorials and samples are currently implemented.

Tutorial 01 – Hello Triangle

Tutorial01_320x240

This tutorial shows how to render a simple triangle using Diligent Engine API.

▶️ Run in the browser

Tutorial 02 – Cube

Tutorial02_Animation_Small

This tutorial demonstrates how to render an actual 3D object, a cube. It shows how to load shaders from files, create and use vertex, index and uniform buffers.

▶️ Run in the browser

Tutorial 03 – Texturing

This tutorial demonstrates how to apply a texture to a 3D object. It shows how to load a texture from file, create shader resource binding object and how to sample a texture in the shader.

▶️ Run in the browser

Tutorial 04 – Instancing

Tutorial04_Animation_Small

This tutorial demonstrates how to use instancing to render multiple copies of one object using unique transformation matrix for every copy.

▶️ Run in the browser

Tutorial 05 – Texture Array

Tutorial05_Animation_Small

This tutorial demonstrates how to combine instancing with texture arrays to use unique texture for every instance.

▶️ Run in the browser

Tutorial 06 – Multithreading

Tutorial06_Animation_Small

This tutorial shows how to generate command lists in parallel from multiple threads.

▶️ Run in the browser

Tutorial 07 – Geometry Shader

Tutorial07_Animation_Small

This tutorial shows how to use geometry shader to render smooth wireframe.

Tutorial 08 – Tessellation

Tutorial08_Animation_Small

This tutorial shows how to use hardware tessellation to implement simple adaptive terrain  rendering algorithm.

Tutorial 09 – Quads

Tutorial09_Animation_Small

This tutorial shows how to render multiple 2D quads, frequently switching textures and blend modes.

▶️ Run in the browser

Tutorial 10 – Data Streaming

Tutorial10_Animation_Small

This tutorial shows dynamic buffer mapping strategy using MAP_FLAG_DISCARD and MAP_FLAG_DO_NOT_SYNCHRONIZE flags to efficiently stream varying amounts of data to GPU.

▶️ Run in the browser

Tutorial 11 – Resource Updates

Tutorial11_Animation_Small

This tutorial demonstrates different ways to update buffers and textures in Diligent Engine and explains important internal details and performance implications related to each method.

▶️ Run in the browser

Tutorial 12 – Render Target

Tutorial12_Animation_Small

This tutorial demonstrates how to render a 3d cube into an offscreen render target and do a simple post-processing effect.

▶️ Run in the browser

Tutorial 13 – Shadow Map

Tutorial13_Animation_Small

This tutorial demonstrates how to render basic shadows using a shadow map.

▶️ Run in the browser

Tutorial 14 – Compute Shader

Tutorial14_Animation_Small

This tutorial shows how to implement a simple particle simulation system using compute shaders.

▶️ Run in the browser

Tutorial 15 – Multiple Windows

Tutorial15_Screenshot

This tutorial demonstrates how to use Diligent Engine to render to multiple windows.

Tutorial 16 – Bindless Resources

Tutorial16_Animation_Small

This tutorial shows how to implement bindless resources, a technique that leverages dynamic shader resource indexing feature enabled by the next-gen APIs to significantly improve rendering performance.

▶️ Run in the browser

Tutorial17 – MSAA

Animation_Small

This tutorial demonstrates how to use multisample anti-aliasing (MSAA) to make geometrical edges look smoother and more temporarily stable.

▶️ Run in the browser

Tutorial18 – Queries

Animation_Small

This tutorial demonstrates how to use queries to retrieve various information about the GPU operation, such as the number of primitives rendered, command processing duration, etc.

▶️ Run in the browser

Atmospheric Scattering Sample

Atmosphere_Animation_Small

This sample demonstrates how to integrate Epipolar Light Scattering post-processing effect into an application to render physically-based atmosphere.

▶️ Run in the browser

GLTF Viewer

damaged_helmet

This sample demonstrates how to use the Asset Loader and GLTF PBR Renderer to load and render GLTF models.

▶️ Run in the browser

Shadows

Screenshot

This sample demonstrates how to integrate the Shadowing component into an application to render high-quality shadows.

▶️ Run in the browser

Dear ImGui Demo

Screenshot

This sample demonstrates the integration of the engine with dear imgui UI library.

▶️ Run in the browser

Nuklear Demo

NuklearDemo_Screenshot

This sample demonstrates the integration of the engine with nuklear UI library.

Hello AR

Screenshot

This sample demonstrates how to use Diligent Engine in a basic Android AR application.

Please visit this GitHub page for build and run instructions.