Code Samples

121 Search Results

Parallel Processing with DirectX 3D* 12

Published on October 20, 2017

We will examine rendering parallel topics using Direct3D* 12, adding a Direct3D render to an existing particle system application.


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.

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.

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...

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).

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 eliminated...

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.

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...

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 books on...

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.

Order-Independent Transparency Approximation with Pixel Synchronization (Update 2014)

Download ZIP This sample has been updated to work with the Windows* 8 SDK and Visual Studio* 2012/2013, removing the dependency on the June 2010 DirectX* SDK. Transparency is a fundamental challenge in real-time rendering due to the difficulty of...

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

Download Sharing Surfaces Code Sample Zipfile Introduction 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 Windows*. One...

XDK Game Support

Intel® XDK’s Initial Release of HTML5 Games Support and iOS* Debugging

  HTML5 Games & Debugging Season’s Greetings Everyone!  Just in time for the holiday season and all of the free time you may have in your holiday and New Year’s vacations, we’re giving you something to really play with – create and package...

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 gives some...

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 counter information for Intel® integrated...

Sierpiński Carpet in OpenCL* 2.0

We demonstrate how to create a Sierpinski Carpet in OpenCL* 2.0 wap_tms = {}; Prerequisites:       A laptop or a workstation with the 5th Generation Intel® Core™ Processor OpenCL™ Drivers and Runtimes for...

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

Download Sample Code ZIPfile Introduction 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 required...

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. Special care has been taken...

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. Introduction Fragment Shader Ordering is a graphics extension that Intel has implemented for OpenGL 4.2 to be used with 4th Generation Intel® Core...

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 significantly...

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 dramatically...

Cloud Rendering Sample

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

Conservative Morphological Anti-Aliasing (CMAA) - March 2014 Update

This article was taken from a blog posting on IDZ by Leigh Davies at Intel Corp, highlighting work and results completed by Leigh and his colleague Filip Strugar in the new AA technique being referred to as Conservative Morphological Anti-Aliasing....

Shadow Mapping Algorithm for Android*

Downloads   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 well-rendered shadows in your games is...

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...

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.

HTML5 Canvas - Tap & Rotate Player with Arctangent

Great code sample showing how to set up move, aim and shoot for a given player on screen.

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

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

Last updated: 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

Last updated: April 5, 2013

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

Case Study: How Intel® GPA Measurements Alerted Me to Greatly Improve the FPS of my Windows* 8 Store App: The DispatcherTimer

Last updated: April 5, 2013

Last year, I wrote a blog about creating your own simple collision detection code.  I implemented this for a children's math game I created.  You can refer to my blog here:

Adaptive Volumetric Shadow Maps

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

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.

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.

Performance Workshop Update - Welcome to the Dark(er) Side

Updates to CityRacer for cross platform usage as a sample framework, show Graphics Performance Analyzer tools and their usage in correcting app issues.

GTD Light Scattering Sample Updated

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

Particle Trimming on OpenGL

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] Abstract This sample demonstrates how Windows 8 Desktop applications can use the...

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.

Head-Coupled Perspective

Head-Coupled Perspective is a technique for rendering a scene that responds naturally and intuitively to changes in the viewer’s position relative to the display.

Adding Multi-Touch Support in Unity* Windows* Apps

Someone asked me recently how to take advantage of multi touch in Unity apps running on Windows 7 & Windows 8 desktop.  I remember saying things like “it should be really easy”, and “Someone must have done that” and “go look for a plugin”.  He...

Adaptive Volumetric Shadow Maps

Published on September 20, 2012

We introduce adaptive volumetric shadow maps (AVSM), a real-time shadow algorithm that supports high-quality shadowing from dynamic volumetric media such as hair and smoke. The key contribution of AVSM is the introduction of a streaming simplification algorithm that generates an accurate volumetric...

Morphological Antialiasing (MLAA)

Published on August 15, 2012

MLAA is an image-based, post-process filtering technique which identifies discontinuity patterns and blends colors in the neighborhood of these patterns to perform effective anti-aliasing.

Light Scattering

Published on August 5, 2012

This sample demonstrates that atmospheric light scattering effects can now be implemented in real time using Intel 3rd Generation Integrated Graphics and produce compelling visual results.

HDR Rendering with Compute Shader

Published on August 5, 2012

This sample demonstrates optimized compute shaders for displaying HDR images

Fluid Simulation for Video Games (part 9)

This is a series on fluid simulation for games. This article describes how to approximate buoyant & gravitational forces on a body immersed in a varying density fluid. Bodies immersed within the fluid float or sink depending on mass of fluid displaced.

Fluid Simulation for Video Games (Part 8)

This is a series on fluid simulation for video games. This article explains how a vortex-based fluid simulation handles variable density in a fluid. The fluid flow includes motion because of buoyancy-heavier fluid sinks, and lighter fluid rises.

Fluid Simulation for Video Games (part 4)

This is a series of articles on fluid simulation. This article augments fluid simulation to include two-way fluid-body interaction and allow rigid body interaction.

Threaded Crowd Simulation with Collision Avoidance

Strategy & arcade genre games have small unit counts due to processing overhead. In Colony, we show how that overhead can be minimized with threading on the CPU and we show how to architect multi-threaded collision avoidance.

CPU Texture Compositing

Published on April 23, 2012

This sample shows that by taking advantage of the fact that the terrain is static, the compositing operation does not need to be done on a frame by frame basis and can instead be pre-computed asynchronously on the CPU on an as-needed basis.

CPU Animation

Published on March 27, 2012

CPU Animation Intel Corporation Features / Description The importance of real-time character animation has greatly increased in modern games. Animating meshes via 'skinning' can be performed on both a general...

Batch Size

Published on March 27, 2012

This sample demonstrates the use of instancing to limit the number of draw calls to minimize driver overhead and maximize hardware efficiency.

Early Z Rejection

Published on March 27, 2012

This sample demonstrates two ways to take advantage of early Z rejection.

Sample Distribution Shadow Maps

This demo showcases an extension to Z-partitioning (cascaded shadow maps) called Sample Distribution Shadow Maps (SDSMs). SDSMs optimize the placement and size of a fixed number of Z-partitions by analyzing the shadow sample distribution required by the current frame. They build on the advantages...

Deferred Rendering for Current and Future Rendering Pipelines

This sample demonstrates a number of deferred rendering techniques including conventional deferred shading, deferred lighting and tile-based deferred shading. Tile-based deferred shading is implemented in DirectX 11 Compute Shader and achieves high performance even with many lights by amortizing...

Adaptive Transparency

We introduce a new technique for real-time order independent transparency called Adaptive Transparency (AT) that closely approximates the ground-truth results obtained from A-buffer compositing but is 5x to 40x faster. The key contribution of Adaptive Transparency is the introduction of an...

Architecture of a Real-Time Ray-Tracer

Published on March 19, 2012

Jacco Bikker, NHTV University of Applied Sciences, Breda, The Netherlands 1. Introduction Recently, it has been shown that ray tracing can be done in real-time on consumer PCs. This is an interesting development; ray tracing solves many of the...

TickerTape Part 2

Ticker Tape is a tech demo that showcases complex particle movement using aerodynamic calculations such as lift & drag while utilizing an n-way threaded framework and SIMD optimizations. This article describes the performance gain from implementing SSE.

Maximizing Performance with Fine-Grained Parallelism

Published on March 5, 2012

Implementing functional decomposition in games to get the most performance from the processor By Andrew Binstock In my previous article, I described how to use functional decomposition to break up games and visual programming apps into tasks that...

Understanding Memory Access Characteristics of Motion Estimation Algorithms

Introduction By Alex A. Lopez-EstradaApplications Engineer, Intel Software and Solutions Group Today, processor computing power makes real-time video encoding and decoding using General Purpose Processors capability a reality. Still, the ability...

Z Fighting Code Sample

This source code demonstrates how game developers can work around any Z fighting issue they may find. The sample source demonstrates several techniques for working around Z fighting issues in DirectX* 9.0.

Carry Small, Game Large

Published on February 9, 2012

Do portable games have to be small?  Check out our article on Gamasutra answering that very question and then download our free code below to test it out yourself. "Carry Small, Game Large" Free Code Download "Carry Small, Game Large"...

Download Optimizing with Intel® TBB

Published on February 9, 2012

Sample code for "Optimizing with TBB" download page