DirectX 11 Examples

DirectX 11 is the latest API for 2D and 3D graphics from Microsoft intended for desktop devices and consoles.

Beginner | Intermediate | Advanced

Beginner

  • HelloAPI

    Draw a triangle to the screen using hardware acceleration.


    Description:

    A basic tutorial that guides the user, step-by-step, through the process of initializing a window using :API:, drawing a triangle in it using hardware acceleration, and then terminating the window.

    Controls:

    Esc : Close the application

    Links:

    DX11HelloAPI.cpp | Projects

  • IntroducingPVRShell

    This training course introduces the PVRShell library.


    Description:

    This demo deals with the PVRShell library. The PowerVR shell handles all OS specific initialisation code, and has several built in command line features which allow for the specifying of attributes. The library is constructed around a 'PVRShell' base class, and object of which is constructed and returned from a 'NewDemo' function.

    Controls:

    Esc : Close the application

    Links:

    DX11IntroducingPVRShell.cpp | Projects

  • Texturing

    This training course demonstrates how to apply a texture to a polygon in :API:.


    Description:

    This training course demonstrates how to apply a texture to a polygon in :API:. The texture is generated procedurally during initialisation and then loaded into :API:. The triangle is then drawn with UV values so that the texture can be applied to it.

    Controls:

    Esc : Close the application

    Links:

    DX11Texturing.cpp | Projects

  • BasicTnL

    This training course consists of a demonstration of basic transformation and lighting.


    Description:

    This training course consists of a demonstration of basic transformation and lighting, growing on the basic drawing techniques learnt in HelloTriangle.

    Controls:

    Esc : Close the application

    Links:

    DX11BasicTnL.cpp | Projects

  • IntroducingPVRTools

    This training course introduces the PVRTools libraries.


    Description:

    This training course introduces the PVRTools libraries. These libraries provide various modules to help developers perform many of the common tasks associated with hardware accelerated graphics rendering.

    Controls:

    Esc : Close the application

    Links:

    DX11IntroducingPVRTools.cpp | Projects

  • IntroducingPrint3D

    This training course introduces the Print3D class featured within the PVRTools library.


    Description:

    This training course introduces the Print3D class from the PVRTools library. Print3D can be used to display text in both 2D and 3D modes. The default projection mode is 2D but supplying a modelview and projection matrices allow the user to render the text in 3D. Text in different colours is also possible.

    Controls:

    Links:

    DX11IntroducingPrint3D.cpp | Projects

  • IntroducingPOD

    This training course introduces the PowerVR Object Data (.pod) format.


    Description:

    This training course introduces the PowerVR Object Data (.pod) format. It goes into detail on how to open .pod files, load any .pfx and .pvr files that have been referenced, and set up the cameras and lights from the .pod file.

    Controls:

    Esc : Close the application

    Links:

    DX11IntroducingPOD.cpp | Projects

Intermediate

  • AlphaBlend

    This training course illustrates how transparency effects can be achieved with blending and the use of some common blending modes.


    Description:

    Blending is a fragment operation that combines the colour value of fragments as they are drawn with values that are already present in the colour buffer. This allows transparent objects to be simulated. This training course shows how to draw blended geometry using four different types of blending modes set with glBlendFunc().

    Controls:

    Esc : Close the application

    Links:

    DX11AlphaBlend.cpp | Projects

  • DisplacementMap

    This training course demonstrates displacement mapping using a texture read from the vertex shader.


    Description:

    Displacement mapping is an alternative to bump mapping, normal mapping, and parallax mapping, that causes the actual geometric position of points over a textured surface to be displaced, often along the local surface normal, according to the value the texture function evaluates to at each point on the surface.

    Controls:

    Esc : Close the application

    Links:

    DX11DisplacementMap.cpp | Projects

  • Reflections

    This training course demonstrates the creation of a reflection effect from a 2D map and a cube map.


    Description:

    This training course demonstrates the creation of a reflection effect from a 2D map and a cube map. This technique is also known as environment mapping in that the environment around an object is rendered into a texture (in this case as a pre-baked step) and then this environment is sampled per fragment in order to simulate the effect of light from the environment being reflected from the object. Two variations on the technique are shown using either a 2D map or a cube map.

    Controls:

    Left/Right : Swap mapping type

    Esc : Close the application

    Links:

    DX11Reflections.cpp | Projects

  • Refraction

    This training course demonstrates a simulation of glass-like materials.


    Description:

    This training course combines an object with a background in order to achieve a refraction effect. The background texture is applied to the model but the sample coordinates are affected by the normals of the geometry in order to simulate how light would be bent through a material with differing refractive index to the air around it.

    Controls:

    Left/Right : Cycle Specular reflection on or off

    Esc : Close the application

    Links:

    DX11Refraction.cpp | Projects

  • RenderToTexture

    This training course demonstrates the use of rendering to a texture.


    Description:

    This training course demonstrates rendering a scene to a pBuffer surface or FBO, then binding and applying that render to an object in an additional render pass.

    Controls:

    Left : Toggles multisampling of the FBOs

    Esc : Close the application

    Links:

    DX11RenderToTexture.cpp | Projects

  • Skinning

    This training course demonstrates how to implement hardware accelerated skinning using .pod files.


    Description:

    This training course demonstrates how to implement hardware accelerated skinning using the .pod file loading tools found in the PVRTools library.

    Controls:

    Left/Right : Rotate model clockwise/anti-clockwise

    Up/Down : Zoom out/in

    Esc : Close the application

    Links:

    DX11Skinning.cpp | Projects

Advanced

  • Coverflow

    A demonstration of a coverflow style effect.


    Description:

    This demo serves as an example of a coverflow style effect, which is a three dimensional GUI used to display information as a stack of snapshots.

    Controls:

    Left/Right : Flow covers left/right

    Esc : Close the application

    Links:

    DX11Coverflow.cpp | Projects

  • Fractal

    A demonstration of drawing a fractal using render to texture.


    Description:

    A recursive fractal effect is demonstrated here using the render to texture technique. This technique is a useful method to create a variety of effects. Basically, a scene is rendered as usual, but in a texture for future reuse.

    Controls:

    Esc : Close the application

    Links:

    DX11Fractal.cpp | Projects

  • Water

    This demo shows how to render a water effect on a given plane


    Description:

    This demo utilises a combination of different techniques to produce a water effect. User input controls the elements that are implemented in the effect so that users can determine the effect that would best suit their needs. When reflection, refraction and depth effects are off, the water colours alpha value is used to blend the plane in with the rest of the rendered world. This adds to the quality of the basic effect for very little cost.

    Controls:

    Left/Right : Cycle backwards/forwards through available options

    Up/Down : Change (Toggle or Increase/Decrease) the currently selected option

    1/Space : Toggle Pause/Unpause

    Links:

    DX11Water.cpp | Projects