Code Samples

140 Search Results

Use Unreal Engine* Particle Effects on the CPU

This article illustrates the Unreal Engine* CPU particle effect through the example of the game Sinner

What Can We Learn from the Intel SPMD Program Compiler?

We have added a new simple SGEMM example to the Intel® SPMD Program Compiler GitHub* repo. The Intel® SPMD Program Compiler is colloquially referred to as “ISPC”, as in the compiler’s executable name “ispc.exe”. The new SGEMM sample is...

Conservative Morphological Anti-Aliasing (CMAA)

The conservative morphological anti-aliasing 2.0 (CMAA2) algorithm is a significant update of the original

Page icon

Code Sample: Intel® Multi-Core Processor Enterprise VR Experience, Integrating Crowd Simulations into Mixed Reality

Code Sample: Intel® Multi-Core Processor Enterprise VR Experience, Integrating Crowd Simulations into Mixed Reality

Code Sample: Conservative Morphological Anti-Aliasing Version 2 (CMAA2)

Published on September 6, 2018By Filip S.

Files(s):DownloadLicense:CMAA2 is licensed under Apache* License 2.0.Optimized for... OS:64-bit Windows® 10Hardware:GPU requiredSoftware:
(Programming Language, tool, IDE,...

Code Sample: API Without Secrets: The Practical Approach to Vulkan*

Learn what resources are needed and how to organize them to efficiently generate and display a single frame of animation in the Vulkan API.

Code Sample: Lightmapping code for prefabs in Unity*

Attach this script as a component to any prefab you might want to lightmap. From the editor window inside Unity you can setup a scene with proper lighting and position your prefabs inside the scene as per your requirements.

Code Sample: Dynamic Checkerboard Rendering Using Microsoft DirectX* 12

The accompanying sample code demonstrates both CBR and DRR and provides a base implementation in a forward rendering pipeline; additionally, the accompanying white paper describes an implementation in a deferred rendering pipeline. While our focus was on integrated graphics processing units (GPUs...

Intel® Multicore Enterprise VR Experience: Integrating Crowd Simulations into Mixed Reality

Developing experiences in virtual reality (VR) is a fun and exciting journey, and without the proper tools or a helping hand it can become quite daunting. To aid in this process, Intel looks to create a roadmap; a series of signposts and lessons learned in a way that helps bridge the gap into the...

Code Sample: MRHand.cs Script for Input in Native UWP Unity* Apps with Motion Controllers.

Attach this script as component to a gameobject in Unity. After setting up a Tracked Pose Driver component in the gameobject to the correct device and handedness the MRHand.cs script will provide you with public Input functions to obtain controller button presses to drive your game.

Code Sample: Rendering Objects in Parallel Using Vulkan* APIs

Published on July 2, 2018

This code and accompanying article (see References below) discuss the process of rendering multiple FBX (Filmbox) and OBJ (Wavefront) objects using Vulkan APIs. The application employs a non-touch graphical user interface (GUI) that reads and displays multiple 3D object files in a common scene.

Rendering Objects in Parallel Using Vulkan* APIs

To help experienced pro and indie developers prepare for Vulkan, this article walks through the code of a sample app that renders multiple .fbx and .obj objects using Vulkan APIs. The app employs a non-touch graphical user interface (GUI) that reads and displays multiple object files in a common...


Using Modern C++ Techniques to Enhance Multi-core Optimizations

Published on June 25, 2018

With multi-core processors now common place in PCs, and core counts continually climbing, software developers must adapt. By learning to tackle potential performance bottlenecks and issues with concurrency, engineers can future-proof their code to seamlessly handle additional cores as they are...

a butterfly

Code Sample: Using Modern C++ Techniques to Enhance Multi-core Optimizations

Published on June 25, 2018

This software example demonstrates how to use multi-core technologies to edit images. There are two parts to this project, a .NET Windows application front end written using C# and Windows Presentation Foundation (WPF) and a C++ DLL which is responsible for the actual manipulation of the image.

Code Sample: Panaconda - A Persistent Memory Version of the Game "Snake"

A persistent memory version of the game Snake that demonstrates features from the PMDK, including pools, pointers, and transactions.

C#JobSystem unity

Code Sample: New Unity* Entity Component, C# Job System, and Burst Compiler

Published on June 1, 2018

The new C# job system and entity component system from Unity* don’t just allow you to easily leverage previously unused CPU resources, they will also help run all your game code more efficiently in general. Then you can use those extra CPU resources to add more scene dynamism and immersion. In this...

starship in space

Get Started with the Unity* Entity Component System (ECS), C# Job System, and Burst Compiler

Published on May 31, 2018

The new C# job system and entity component system from Unity* don't just allow you to easily leverage previously unused CPU resources, they will also help run all your game code more efficiently in general. Then you can use those extra CPU resources to add more scene dynamism and immersion. In this...

woman in a virtual environment

Code Sample: Custom Audio Editor Tool with Unreal Engine* for Sound Spatialization in VR

Published on May 30, 2018

This Code Sample show you step-by-step on building a useful tool for VR devs using Unreal Engine that leverages the power of intel CPU’s. Unreal Engine has a powerful virtual reality editor option, but something they did not include is the ability to edit and place sounds while inside VR. It can...

Grayscale in game output

Code Sample: Merging Masked Occlusion Culling Hierarchical Buffers

Efficient occlusion culling in dynamic scenes is a very important topic to the game and real-time graphics community in order to accelerate rendering. Masked Software Occlusion Culling [J. Hasselgren, M. Andersson, T. Akenine-Möller] presented a novel algorithm optimized for SIMD-capable CPUs that...

Merging Masked Occlusion Culling Hierarchical Buffers for Faster Rendering

The article and code sample are an addition to the preceding work by Andersson et al. that addresses many of these problem cases by splitting a scene into multiple buffers that better fit local dynamic ranges of geometry and that can be computed concurrently. We then augment the algorithm's discard...

code sample

Code Sample: An Approach to Parallel Processing with Unreal Engine*

Published on April 26, 2018

In this example, a flock was defined as a school of fish. For each member, the algorithm needs to worry about cohesion, alignment and separation. Each fish was calculated to “swim” within a school if it was within a certain distance from any other fish in the school. Members of a school will not...

game development

Code Sample: Parallel Techniques in Modeling Particle Systems Using Vulkan* API

Published on April 23, 2018

This code sample and accompanying article (see References below) discuss and compare aspects of the implementation of a particle system using CPU and GPU using a Vulkan-based renderer as an example. We recommend that you read the article while looking at the code. Make sure you have the examples...


Code Sample: An Approach to Parallel Processing with Unity*

Published on April 10, 2018

This code and accompanying article (see References below) cover development of a flocking algorithm, which is then demonstrated as schools of fish via two applications. The first application was developed to run on a multi-threaded CPU, and the second to perform physics calculations on the GPU.

parallel particle processing

Code Sample: Parallel Processing with Direct3D* 12

Published on April 4, 2018

The idea behind this project was to provide a demonstration of parallel processing in gaming with Direct3D 12. It expands upon the results from the paper "A Comparison of the Intel® Core™ i5 Processor and Intel® Core™ i7 Processor with Visualizations in OpenGL* and Oculus* VR" (see References...

Face Beautification API for Intel Graphics Technology Table 1

Face Beautification API for Intel® Graphics Technology

This document highlights the C++ API for enabling applications to support Face Beautification It provides the list of available effects in Face Beautification supported by Intel Graphics Technology, C++ API definitions, and methods to enable an application to use the C++ Face Beautification API...

Order-Independent Transparency Approximation with Raster Order Views (Update 2017)

Download Original Sample  Download Update

This is an update to the original sample from 2014, the update has two main changes compared to the previous code along with updating the samples to compile with the most recent versions of the...

Parallel Processing with DirectX 3D* 12

Published on October 20, 2017

We will examine rendering parallel topics using Direct3D* 12. We will use the results from the paper, A Comparison of the Intel® Core™ i5 Processor and Intel® Core™ i7 Processor with Visualizations in OpenGL* and Oculus* VR, and extend the code there to contain a Direct3D 12 renderer, after which...


Use the Intel® SPMD Program Compiler for CPU Vectorization in Games

Migrate highly vectorized GPU compute kernels to CPU code using the Intel® SPMD Program Compiler (commonly referred to in previous documents as ISPC). Includes a link to a Github code sample to help you utilize spare CPU cycles to create a richer gaming experience.

API without Secrets: Introduction to Vulkan* Part 6

This part of the tutorial presented a way to use textures (combined image samplers, in fact) inside shaders. To do this we created an image and allocated and bound a memory to it. We also created an image view. Next, we copied data from a staging buffer to the image to initialize its contents. We...

Adaptive Screen Space Ambient Occlusion

This article introduces a new implementation of the effect called adaptive screen space ambient occlusion (ASSAO), which is specially designed to scale from low-power devices and scenarios up to high-end desktops at high resolutions, all under one implementation with a uniform look, settings, and...

Intro to Device Side AVC Motion Estimation

This article introduces the new device-side h.264/Advanced Video Coding (AVC) motion estimation extensions for OpenCL* available for Intel Processor Graphics GPUs. Video motion estimation is a powerful feature which can enable new ways of thinking about many algorithms for video codecs and computer...

Unreal Engine* 4: Blueprint CPU Optimizations for Cloth Simulations

Realistic cloth movement can bring a great amount of visual immersion into a game. Using PhysX* Clothing* is one way to do this without the need of hand animating. Incorporating these simulations into Unreal Engine* 4 is easy, but as it is a taxing process on the CPU, it’s good to understand their...

Unreal Engine* 4: Setting Up Destructive Meshes

The following is a quick guide on getting a PhysX* Destructible Mesh (DM) working setup in an Unreal Engine* 4 (UE4*) project. This guide is primarily based on personal trial and error; other methods may exist that work better for your project. See official documentation for tutorials on fracturing...

OpenGL* Performance Tips: Textures Have Better Rendering Performance than Images

This article discusses why using a texture rather than an image can improve OpenGL rendering performance. It is accompanied by a simple C++ application that alternates between using a texture and using an image. The purpose of this application is to show the effect on rendering performance (...

API without Secrets: Introduction to Vulkan* Part 4: Vertex Attributes

Learn how to add vertex attributes to a graphics pipeline, create buffers, reorganize rendering code, and more in this Vulkan* tutorial.

OpenGL* Performance Tips: Atomic Counter Buffers versus Shader Storage Buffer Objects

Accompanying this article is a simple C++ application that alternates between SSBOs and ACBs. Game developers can see the effect of both methods on rendering performance (milliseconds per frame). While this article refers to graphical game developers, the concepts apply to all applications that use...

Advanced Rendering Techniques and Code Samples GPU Pro 7

MSAA provides a neat way to reduce pixel shading without sacrificing image quality. Recently, researchers at Intel came up a with a technique called Coarse Pixel Shading that works like MSAA, Andrew Lauritzen at Intel, had come up with a clever way a few years ago to enable MSAA and deferred...

Using Vulkan graphics API to Render a Cloud of Animated Particles in Stardust Application

The Stardust sample application uses the Vulkan graphics API to efficiently render a cloud of animated particles. To highlight Vulkan’s low CPU overhead and multithreading capabilities, particles are rendered using 200,000 draw calls. The demo is not using instancing; each draw call uses different...

API without Secrets: Introduction to Vulkan* Part 3: First Triangle

This tutorial presents how to draw first triangle! At the beginning a render pass with one subpass is created. Next image views and framebuffers are created for each swap chain image. After that graphics pipeline creation is presented for which shader modules (with SPIR-V shaders) are required and...

API without Secrets: Introduction to Vulkan* Part 1: The Beginning

This tutorial explains how to start using Vulkan API in an application. It shows how to create Vulkan instance and check what physical devices are available. Next logical device is created along with description about what and how many queues must be created along it. Last thing is the acquisition...

API without Secrets: Introduction to Vulkan* Part 2: Swap Chain

This part discusses swap chain creation. First a set of parameters describing presentation surface is acquired and then proper values for swap chain creation are chosen. Next way to create and record of command buffers is presented (focusing on image layout transitions through image memory barriers...

API without Secrets: Introduction to Vulkan* Part 0: Preface

Follow Pawel L. to learn about Intel's graphic driver support for the emerging Vulkan* graphics API. He'll be providing several tutorials along with Github source code.

GPU Detect

Published on September 21, 2015, updated February 23, 2016

GPU Detect is a short graphics code sample demonstrates a way to detect the primary graphics hardware present in a system (including the 6th Generation Intel® Core™ processor family).

Multi-Adapter Support in DirectX* 12

Published on September 21, 2015, updated February 23, 2016

This sample shows how to implement an explicit multi-adapter application using DirectX 12. Intel’s integrated GPU (iGPU) and a discrete NVIDIA GPU (dGPU) are used to share the workload of ray-tracing a scene. The parallel use of both GPUs allows for an increase in performance and for more complex...

Software Occlusion Culling Figure 1

Software Occlusion Culling

This article details an algorithm and associated sample code for software occlusion culling which is available for download. The technique divides scene objects into occluders and occludees and culls occludees based on a depth comparison with the occluders that are software rasterized to the depth...

DX12 flip model swap chains

Sample Application for Direct3D 12 Flip Model Swap Chains

D3D12 supports only flip model swap chains. This article helps you understand the parameters in a flip model swap chain, links to an application that lets you play with these parameters, and points you to the application's sample code.

Programmable Blend with Pixel Shader Ordering

This sample demonstrates how to use Pixel Shader Ordering to perform blending in a pixel shader without using fixed function blending.

Example of marble surface generated with Perlin noise using OpenCl

Parallel Noise and Random Functions for OpenCL™ Kernels

This article describes and links to the Noise code sample. The sample includes an implementation of Perlin noise, which is useful for generating natural-looking textures, such as marble and clouds, for 3D graphics. It also includes a set of pseudo-random number generator functions that are...

Asteroids and DirectX* 12: Performance and Power Savings

Initially shown at SIGGRAPH 2014, Intel's Asteroids code sample uses the Microsoft DirectX* 12 graphics API to render a scene of 50,000 fully dynamic and unique asteroids in two modes: maximum performance and maximum power saving. The application can switch between using the DirectX 11 and DirectX...

Fast ISPC Texture Compressor - Update

This code sample extends our state of the art BC7 Texture compressor with high-quality ETC1 and ASTC compression to the fast ISPC texture compression.

Squares – 10-point Touch Sample

Download Squares Game Executable Download Sample Code

Squares is a 4-player game where players face off against each other to eliminate all the squares of their designated color as fast as possible. Everyone is timed, so players know who...

City Racer Icon

Tutorial: Using Intel® GPA to improve the performance of your Android* game

This tutorial presents a step-by-step guide to performance analysis, bottleneck identification, and rendering optimization of an OpenGL ES* 3.0 application on Android*. The sample application, entitled “City Racer,” simulates a road race through a stylized urban setting. Performance analysis of...

Adaptive Volumetric Shadow Maps for Android* Using OpenGL* ES 3.1

As a follow-up to Adaptive Volumetric Shadow Maps for DirectX* 11, we present a port of the same algorithm adapted for Android* devices that support OpenGL ES* 3.1 and the GL_INTEL_fragment_shader_ordering OpenGL* extension.

Using OpenCL™ 2.0 Read-Write Images

While Image convolution is not as effective with the new Read-Write images functionality, any image processing technique that needs be done in place may benefit from the Read-Write images. One example of a process that could be used effectively is image composition. In OpenCL 1.2 and earlier,...

The Last Line Effect

I have studied numbers of errors caused by using the Copy-Paste method and can assure you that programmers most often tend to make mistakes in the last fragment of a homogeneous code block. I have never seen this phenomenon described in...

Fast Fourier Transform for Image Processing in DirectX* 11

This sample demonstrates an optimized FFT that uses compute shaders and Shared Local Memory (SLM) to improve performance by reducing memory bandwidth.Two FFT techniques are discussed. The first is UAV and operates by ping-ponging data repeatedly between Unordered Access Views (UAVs). SLM (Shared...

3D Fluid Simulation Using OpenCL™ Technology

The sample demonstrates shallow water solver implemented with the OpenCL™ technology. The Shallow Water sample relies on flux splitting method for solving the approximated Navier-Stokes equations.

HDR Rendering with God Rays Using OpenCL™ Technology

This sample demonstrates a CPU-optimized implementation of the God Rays effect, showing how to: Implement calculation kernels using the OpenCL™ technology C99 Parallelize the kernels by running several work-groups in parallel Organize data exchange between the host and the OpenCL device

HDR Tone Mapping for Post Processing Using OpenCL™ Technology

The Tone Mapping sample demonstrates how to use high dynamic range (HDR) rendering with tone mapping effect with OpenCL™ technology.

Sharing Surfaces between OpenCL™ and OpenGL* 4.3 on Intel® Processor Graphics using implicit synchronization

Download Sharing Surfaces Code Sample Zipfile


This example demonstrates the creation of a texture in OpenGL* 4.3 that has a sub-region updated by an OpenCL™ C kernel running on Intel® Processor Graphics with Microsoft...

Sparse Procedural Volumetric Rendering Fire

Sparse Procedural Volumetric Rendering

Download Source Code ZIPfile

Sparse Procedural Volumetric Rendering (SPVR) is a technique for rendering real-time volumetric effects. We’re excited that the upcoming book “GPU Pro 6” will include an SPVR chapter. This document...

Guide Your Heterogenous Programming Decisions with Intel® Graphics Processor Performance Attributes in GPUInfo

Download Sample Code ZIPfile

About the Sample

The GPUInfo sample code associated with this paper demonstrates the use of Microsoft D3D9, DXGI and D3D11 APIs to obtain Intel-specific, performance-related...

Sierpiński Carpet in OpenCL* 2.0

We demonstrate how to create a Sierpinski Carpet in OpenCL* 2.0

wap_tms = {};


      A laptop or a workstation with the 5th Generation Intel® Core™ Processor


Efficient Order-Independent Transparency on Android* Using Fragment Shader Ordering

Download Sample Code ZIPfile


This sample demonstrates the use of the extension GL_INTEL_fragment_shader_ordering, which is written against the OpenGL* 4.4 core profile and GLES 3.1 specifications. The minimum OpenGL version...

Fluid Simulation for Video Games (part 3)

Simulation of fluids in games has been limited due to the computational challenges. This article describes numerical techniques used to compute approximate solutions to fluid motion.

Cloud Rendering Sample Updated

An update to the cloud rendering samples with several improvements.

Clustered Shading Screenshot

Forward Clustered Shading



This sample demonstrates Forward Clustered Shading, a recently proposed light culling method that allows the convenience of forward rendering, requires a single geometry pass, and efficiently handles high light counts...

Clustered Shading Android* Sample

Provides instructions and samples for clustered shading in Android*.

An investigation of fast real-time GPU-based image blur algorithms

Explains blur filters, how to apply for different hardware types, and other optimizations.

Deferred Rendering for OpenGL* ES3.0 on Android*

This article outlines how you can efficiently implement rendering techniques on mobile devices using OpenGL* ES such as: forward rendering, deferred lighting (light pre-pass) and deferred shading.

Tessellation for OpenGL* ES 3.1 on Android*

This article explains tessellation, how to enable and make best use of this technique within OpenGL* graphics.

Fragment Shader Ordering with OpenGL 4.2

This Windows OpenGL 4.2 Sample was written by John Hartwig - Software Engineer at Intel Corporation.


Fragment Shader Ordering is a graphics extension that Intel has implemented for OpenGL 4.2 to be used with 4th Generation...

Android* Texture Compression - a comparison study with code sample

This sample demonstrates how to load and use various texture formats with OpenGL ES* on Android.

OpenGL* ES 3.0 Precompiled Shaders

Another great Android OpenGL ES 3.0 sample from Cristiano Ferreira - Graphics Software Engineer with Intel Corporation.

Programmatically compiling all shaders the first time an application is run and saving the binaries for reuse can...

Instanced Objects arranged all in a circle

OpenGL* ES 3.0 Instanced Rendering

This Android OpenGL ES 3.0 Sample was written by Cristiano Ferreira - Software Engineer at Intel Corporation.

By batch-rendering multiple versions of the same mesh, instanced rendering can help developers using OpenGL* ES 3.0 and later...

A Basic Sample of OpenCL™ Host Code

Download PDF [686.3 kB]

Download Sample OCL ZIP [10.89 mB]

Contents Introduction About the Sample OpenCL Implementation. Limitations OpenCL Application Basics. Project Structure. OpenCL APIs Used. Controlling...

Cloud Rendering Sample

Using Pixel Shader Ordering a, DirectX extension, Cloud Rendering is vastly improved with better outdoor lighting technology.

Shadow Mapping Algorithm for Android*



Shadow Mapping Algorithm for Android* [PDF 440KB]


"There is no light without shadows" - Japanese proverb

Because shadows in games make them more realistic and interesting, including...

Power Explorer

Today any review of a new processor whether it’s used in a desktop computer, a laptop, a tablet or a phone will contain lots of information about how efficient it is and the new technologies that have been used to achieve this performance. Operating system developers spend large amounts of time...

Conservative Morphological Anti-Aliasing (CMAA)


This sample presents a new, image-based, post-processing antialiasing technique referred to as Conservative Morphological Anti-Aliasing and can be downloaded here. The technique was originally developed by Filip Strugar at Intel for use...

Outdoor Light Scattering Sample Update

Documents release updates that implements multiple scattering of sun light, faster rendering of light shafts, improved shaders and better tone mapping.

Software Occlusion Culling Update 2

Updates to Software Occlusion Culling with rasterizer optimizations to help improve frame rate and total cull time.

Virtual Trackpad

How to implement an on screen virtual track pad for control of UI segments in a game.

Outdoor Light Scattering Sample

How to implement high-quality light scattering effects into large outdoor environments in real time.

Dynamic Resolution Rendering on OpenGL* ES 2.0

Published on June 19, 2013

Dynamic resolution rendering gives developers and users more control over the performance versus image quality ratio.

Touch keyboard access for Windows* 8 desktop apps

Leveraging built in virtual keyboard access in full screen mode games and applications.

Foliage Patch - Organizing Our Data

This blog post discusses how we organize our foliage data with patches where we separate foliage rendering into full-3D objects near the camera, and 2D billboard proxies further away (and for small objects near the camera).

Let's Render Some Foliage

This blog series discusses some ideas and issues around rendering foliage. We provide a sample program (with source code) to demonstrate the ideas.

Creating Compelling Content with XAML for Windows* Store Apps: Control Templates, ListView,ListBox, Customization, and a Game Title Screen

Published on April 25, 2013

Improve Windows* Store Apps by leveraging XAML control templates, ListView, ListBox and other customization.

How to Throw a UIElement Across the Screen Using C# in Windows 8 Style Apps

Published on April 5, 2013

How to apply physics to finger flicks and other adaptations of collision detection code.

CPU Texture Compositing with InstantAccess

This sample updates the existing CPU Texture Compositing to use the InstantAccess extension for the composited textures within 4th Generation Intel® Core™ processors Iris™ and Iris™ Pro graphics.

Adaptive Volumetric Shadow Maps

How to generate real-time adaptively sampled shadow representations for transmittance through volumetric media.

Software Occlusion Culling Update

This update consists of new features and optimizations which have reduced the total Software Occlusion Culling time and the total frame time by a factor of 4X and 2X respectively.

GTD Light Scattering Sample Updated

How to extend light scattering to support spot and point light sources.

Particle Trimming on OpenGL*

Published on March 14, 2013

How to increase performance by trimming particle quads down in size to decrease the amount of unnecessary texture sampling.

Real-Time Strategy Game with Touch Screen

The availability of Ultrabook and Win 8 Tablets create a new frontier for PC gaming; one that brings touch and sensors inputs to parity with mouse and keyboard

Accessing Microsoft Windows* 8 Desktop Sensors Sample

This sample demonstrates how Windows* 8 Desktop applications can use the sensors that are available in Intel® Ultrabook™ PCs and tablets.

Accessing Microsoft Windows* 8 Desktop Sensors

Download Source and Article

Download Windows*8 Desktop Sensors Code Sample [zipfile 4.5MB]
Download Accessing Microsoft Windows* 8 Desktop Sensors[PDF 577KB]


This sample demonstrates how Windows 8 Desktop applications...

Coding Android* Game App to Support Intel x86? Here Are Some Samples!

Code samples that assist with supporting both ARM and x86 Android architectures.

Touch Terrain

This sample demonstrates a technique which enables the user to dynamically deform terrain using a touch screen.