Demonstrates how to create and use block compressed images (DDS files) in a Windows Store app.

How to use this sample

This sample project uses block compressed (DDS) images that are generated by the ImageContentPipeline C++ project. Before running the this sample, you must first perform the following steps:

  1. In Solution Explorer, right click on the ImageContentPipeline C++ project and select Build. This project has the ImageContentTask custom build step set up to convert guitar-transparent.png and oldWood4_nt.jpg (in the OriginalAssets folder) to block compressed (DDS) form in the BlockCompressedAssets folder.

    Note  You can view the ImageContentTask settings by right clicking on one of the images and selecting Properties.

  2. In Solution Explorer, right click on the BlockCompressedAssets folder > Add > Existing Item.
  3. Navigate to the BlockCompressedAssets folder and add the two DDS images. (guitar-transparent.dds and oldWood4_nt.dds)
About block compressed images in Windows Store apps:

Block compression is a technique for reducing GPU memory consumption of image assets, as described in Block Compression (Direct3D 10). Any Microsoft Visual Studio C++ project may be used to generate block compressed images by adding the ImageContentTask build customization to the project, as described in Using 3-D Assets in Your Game or App. Windows Store app can support DDS files using the following block compression formats:

  • BC1_UNORM (for opaque or 1 bit transparency images)
  • BC2_UNORM (for images with transparency)
  • BC3_UNORM (for images with transparency that is spatially correlated)

In addition, the following restrictions must be observed:

  • Select Yes for the Convert to pre-multiplied alpha format option in Visual Studio.
  • Select No for the Generate Mips option in Visual Studio.
  • The image must be a multiple of 4 pixels in width and height.
Generating your own image assets

The ImageContentPipeline project has been customized to make DDS asset creation more convenient:

  • By default, any new images that are set as Item Type = Image Content Pipeline will use premultiplied alpha and will not generate mipmaps. This matches the requirements of Windows Store apps.

    Note  You still must select a valid compression mode (BC1_UNORM, BC2_UNORM, or BC3_UNORM) and ensure that your image is a multiple of 4 pixels in width and height.

    The project output directory is set to BlockCompressedAssets regardless of platform or configuration.

Related topics

Block Compression (Direct3D 10)
Using 3-D Assets in Your Game or App
Windows app samples

Operating system requirements

Client
Windows 8.1
Server
Windows Server 2012 R2

Build the sample

  1. Start Visual Studio 2013 and select File > Open > Project/Solution.
  2. Go to the directory in which you unzipped the sample. Go to the directory named for the sample, and double-click the Visual Studio 2013 Solution (.sln) file.
  3. Press F7 or use Build > Build Solution to build the sample.

Run the sample

To debug the app and then run it, press F5 or use Debug > Start Debugging. To run the app without debugging, press Ctrl+F5 or use Debug > Start Without Debugging.