Quantcast
Channel: DirectXTex texture processing library
Viewing all 1174 articles
Browse latest View live

Created Task: D3DX11Create*From* Sample [1328]

$
0
0
There's no directly equivalent DirectXTex function to the legacy D3DX11 functions D3DX11CreateTextureFromFile, D3DX11CreateShaderResourceViewFromFile, D3DX11CreateTextureFromMemory, and D3DX11CreateShaderResourceViewFromMemory. The same operations can be performed by DirectXTex, and generally these old functions are total overkill for most users.

However, a utility that demonstrates how to implement all the old 'full-fat' functionality' could be useful for porting as well as be a good sample of how to use DirectXTex in complex ways (rather than just texconv/texassemble).

```
typedef enum D3DX11_FILTER_FLAG {
D3DX11_FILTER_NONE = (1 << 0),
D3DX11_FILTER_POINT = (2 << 0),
D3DX11_FILTER_LINEAR = (3 << 0),
D3DX11_FILTER_TRIANGLE = (4 << 0),
D3DX11_FILTER_BOX = (5 << 0),
D3DX11_FILTER_MIRROR_U = (1 << 16),
D3DX11_FILTER_MIRROR_V = (2 << 16),
D3DX11_FILTER_MIRROR_W = (4 << 16),
D3DX11_FILTER_MIRROR = (7 << 16),
D3DX11_FILTER_DITHER = (1 << 19),
D3DX11_FILTER_DITHER_DIFFUSION = (2 << 19),
D3DX11_FILTER_SRGB_IN = (1 << 21),
D3DX11_FILTER_SRGB_OUT = (2 << 21),
D3DX11_FILTER_SRGB = (3 << 21)
} D3DX11_FILTER_FLAG, *LPD3DX11_FILTER_FLAG;

typedef struct D3DX11_IMAGE_LOAD_INFO {
UINT Width;
UINT Height;
UINT Depth;
UINT FirstMipLevel;
UINT MipLevels;
D3D11_USAGE Usage;
UINT BindFlags;
UINT CpuAccessFlags;
UINT MiscFlags;
DXGI_FORMAT Format;
UINT Filter;
UINT MipFilter;
D3DX11_IMAGE_INFO *pSrcInfo;
} D3DX11_IMAGE_LOAD_INFO, *LPD3DX11_IMAGE_LOAD_INFO;

HRESULT D3DX11CreateTextureFromFile(
_In_ ID3D11Device *pDevice,
_In_ LPCTSTR pSrcFile,
_In_ D3DX11_IMAGE_LOAD_INFO *pLoadInfo,
_Out_ ID3D11Resource **ppTexture,
_Out_ HRESULT *pHResult
);

HRESULT D3DX11CreateTextureFromMemory(
_In_ ID3D11Device *pDevice,
_In_ LPCVOID pSrcData,
_In_ SIZE_T SrcDataSize,
_In_ D3DX11_IMAGE_LOAD_INFO *pLoadInfo,
_Out_ ID3D11Resource **ppTexture,
_Out_ HRESULT *pHResult
);

HRESULT D3DX11CreateShaderResourceViewFromFile(
_In_ ID3D11Device *pDevice,
_In_ LPCTSTR pSrcFile,
_In_ D3DX11_IMAGE_LOAD_INFO *pLoadInfo,
_Out_ ID3D11ShaderResourceView **ppShaderResourceView,
_Out_ HRESULT *pHResult
);

HRESULT D3DX11CreateShaderResourceViewFromMemory(
_In_ ID3D11Device *pDevice,
_In_ LPCVOID pSrcData,
_In_ SIZE_T SrcDataSize,
_In_ D3DX11_IMAGE_LOAD_INFO *pLoadInfo,
_Out_ ID3D11ShaderResourceView **ppShaderResourceView,
_Out_ HRESULT *pHResult
);
```


Edited Task: D3DX11Create*From* Sample [1328]

$
0
0
There's no directly equivalent DirectXTex function to the legacy D3DX11 functions D3DX11CreateTextureFromFile, D3DX11CreateShaderResourceViewFromFile, D3DX11CreateTextureFromMemory, and D3DX11CreateShaderResourceViewFromMemory. The same operations can be performed by DirectXTex, and generally these old functions are total overkill for most users.

However, a utility that demonstrates how to implement all the old 'full-fat' functionality' could be useful for porting as well as be a good sample of how to use DirectXTex in complex ways (rather than just texconv/texassemble).

_Note that I won't be implementing the "ThreadPump" async loader behavior that is tied into some D3DX11 only tech_

```
typedef enum D3DX11_FILTER_FLAG {
D3DX11_FILTER_NONE = (1 << 0),
D3DX11_FILTER_POINT = (2 << 0),
D3DX11_FILTER_LINEAR = (3 << 0),
D3DX11_FILTER_TRIANGLE = (4 << 0),
D3DX11_FILTER_BOX = (5 << 0),
D3DX11_FILTER_MIRROR_U = (1 << 16),
D3DX11_FILTER_MIRROR_V = (2 << 16),
D3DX11_FILTER_MIRROR_W = (4 << 16),
D3DX11_FILTER_MIRROR = (7 << 16),
D3DX11_FILTER_DITHER = (1 << 19),
D3DX11_FILTER_DITHER_DIFFUSION = (2 << 19),
D3DX11_FILTER_SRGB_IN = (1 << 21),
D3DX11_FILTER_SRGB_OUT = (2 << 21),
D3DX11_FILTER_SRGB = (3 << 21)
} D3DX11_FILTER_FLAG, *LPD3DX11_FILTER_FLAG;

typedef struct D3DX11_IMAGE_LOAD_INFO {
UINT Width;
UINT Height;
UINT Depth;
UINT FirstMipLevel;
UINT MipLevels;
D3D11_USAGE Usage;
UINT BindFlags;
UINT CpuAccessFlags;
UINT MiscFlags;
DXGI_FORMAT Format;
UINT Filter;
UINT MipFilter;
D3DX11_IMAGE_INFO *pSrcInfo;
} D3DX11_IMAGE_LOAD_INFO, *LPD3DX11_IMAGE_LOAD_INFO;

HRESULT D3DX11CreateTextureFromFile(
_In_ ID3D11Device *pDevice,
_In_ LPCTSTR pSrcFile,
_In_ D3DX11_IMAGE_LOAD_INFO *pLoadInfo,
_Out_ ID3D11Resource **ppTexture
);

HRESULT D3DX11CreateTextureFromMemory(
_In_ ID3D11Device *pDevice,
_In_ LPCVOID pSrcData,
_In_ SIZE_T SrcDataSize,
_In_ D3DX11_IMAGE_LOAD_INFO *pLoadInfo,
_Out_ ID3D11Resource **ppTexture
);

HRESULT D3DX11CreateShaderResourceViewFromFile(
_In_ ID3D11Device *pDevice,
_In_ LPCTSTR pSrcFile,
_In_ D3DX11_IMAGE_LOAD_INFO *pLoadInfo,
_Out_ ID3D11ShaderResourceView **ppShaderResourceView
);

HRESULT D3DX11CreateShaderResourceViewFromMemory(
_In_ ID3D11Device *pDevice,
_In_ LPCVOID pSrcData,
_In_ SIZE_T SrcDataSize,
_In_ D3DX11_IMAGE_LOAD_INFO *pLoadInfo,
_Out_ ID3D11ShaderResourceView **ppShaderResourceView
);
```

Source code checked in, #fe6aae0db24d52363591cfe76d86f64ed52c1297

Updated Wiki: DirectXTex

$
0
0
The DirectXTex library includes a full-featured DDS reader and writer including legacy format conversions, a TGA reader and writer, a WIC-based bitmap reader and writer (BMP, JPEG, PNG, TIFF, and HD Photo), and various texture processing functions. This is intended primarily for tool usage.

The library assumes that the client code will have already called CoInitialize, CoInitializeEx, or Windows::Foundation::Initialize as needed by the application before calling any DirectXTex routines

Headers

The majority of the header files here are intended for internal implementation of the library only (BC.h, DDS.h, DirectXTexP.h, and scoped.h). Only DirectXTex.h (and DirectXTex.inl) is meant as a 'public' header for the library.

Namespace

All the functions in the library are in the DirectX C++ namespace.

Functions

DDS I/O Functions

TGA I/O Functions

WIC I/O Functions

Texture Functions

Direct3D 11 Helper Functions

Utility Functions

Structures

TexMetadata contains metadata information about the texture resource and organization such as width, height, depth, format, dimension, etc.
  • TEX_DIMENSION_TEXTURE1D, TEX_DIMENSION_TEXTURE2D, and TEX_DIMENSION_TEXTURE3D are alises for D3D10_RESOURCE_DIMEMSION and D3D11_RESOURCE_DIMENSION.
  • TEX_MISC_TEXTURECUBE is an alias for the same D3D10_RESOURCE_MISC_FLAG and D3D11_RESOURCE_MISC_FLAG.
  • TEX_MISC2_ALPHA_MODE_MASK is a mask for miscFlags2 to obtain the TEX_ALPHA_MODE.
Image contains information about the surface including width, height, format, rowPitch, slicePitch, and a pointer to pixel data. Note that for 1D and 2D images, slicePitch should be set to the full size of the image.

ScratchImage is a helper class that manages memory for functions that return a Image or set of Images.

Blob is a helper class that manages for functions that return a binary blob of data.

Rect contains a simple pixel-based rectangle used by the CopyRectangle function.

Adding to a VS solution

In your application's solution, right-click on the Solution and use "Add \ Existing Project..." to add the appropriate .vcxproj file to your solution.
  • DirectXTex_Desktop_2015 is for Windows desktop applications building with VS 2015.
  • DirectXTex_Desktop_2013 is for Windows desktop applications building with VS 2013 Express for Desktop, VS 2013 Community, VS 2013 Professional or higher.
  • DirectXTex_Desktop_2012 is for Windows desktop applications building with VS 2012 Express for Desktop, VS 2012 Professional or higher
  • DirectXTex_Desktop_2010 is for Windows desktop applications building with VS 2010 using the Windows 8.1 SDK
  • DirectXTex_Windows10 is for universal Windows apps building with VS 2015 targeting Windows 10
  • DirectXTex_Windows81 is for Windows Store apps building with VS 2013 targeting Windows 8.1
  • DirectXTex_Windows8 is for Windows Store apps building with VS 2012 targeting Windows 8
  • DirectXTex_WindowsPhone81 is for Windows phone 8.1 apps building with VS 2013 Update 2 or later.
  • DirectXTex_XboxOneXDK is for Xbox One exclusive apps building with VS 2012 using the Xbox One XDK
  • DirectXTex_XboxOneADK is for Xbox One hub apps building with VS 2012 using the Xbox One ADK
In your application's project, right-click on the Project and use "References...", then "Add New Reference...", and then check the DirectXTex project name and click OK. For a Windows Store app, Windows phone, or Xbox One solution, you need to set Reference Assembly Output to false since DirectXTex is a static C++ library and not a WinRT component.

In your application's project settings, on the "C++ / General" page set Configuration to "All Configurations", set Platform to "All Platforms", and then add the relative path to DirectXTex;--assuming you have the DirectXTex folder in the same directory as your sln file, it should be $(SolutionDir$)\DirectXTex;--to the Additional Include Directories properties. Click Apply.

When using VS 2010 with the Windows 8.x SDK http://go.microsoft.com/fwlink/?LinkID=323507, or when using VS 2012 with the Windows 8.1 SDK, you'll need to apply the correct .props files to your projects as well as use the correct DirectXTex project. http://blogs.msdn.com/b/vcblog/archive/2012/11/23/using-the-windows-8-sdk-with-visual-studio-2010-configuring-multiple-projects.aspx

http://blogs.msdn.com/b/vcblog/archive/2010/05/03/flexible-project-to-project-references.aspx

Note: DirectXTex is not supported on Windows Phone 8.0, because WIC is not available on that platform. The .DDS files it generates are suitable for use on Windows Phone 8.x assuming the pixel format is supported by the device (currently Feature Level 9.3).

Release Notes

  • The alpha mode specification for DDS files was updated between the March 2013 and April 2013 releases. Any DDS files created using the DDS_FLAGS_FORCE_DX10_EXT_MISC2 flag or the texconv -dx10 switch using the March 2013 release should be refreshed.
  • Due to the underlying Windows BMP WIC codec, alpha channels are not supported for 16bpp or 32bpp BMP pixel format files. The Windows 8 version of the Windows BMP WIC codec does support 32bpp pixel formats with alpha when using the BITMAPV5HEADER file header.
  • While DXGI 1.0 and DXGI 1.1 include 5:6:5 (DXGI_FORMAT_B5G6R5_UNORM) and 5:5:5:1 (DXGI_FORMAT_B5G5R5A1_UNORM) pixel format enumerations, the DirectX 10.x and 11.0 Runtimes do not support these formats for use with Direct3D. The DirectX 11.1 runtime, DXGI 1.2, and the WDDM 1.2 driver model fully support 16bpp formats (5:6:5, 5:5:5:1, and 4:4:4:4).
  • Loading of 96bpp floating-point TIFF files results in a corrupted image prior to Windows 8. This fix is available on Windows 7 SP1 with KB 2670838 installed.

Updated Wiki: DirectXTex

$
0
0
The DirectXTex library includes a full-featured DDS reader and writer including legacy format conversions, a TGA reader and writer, a WIC-based bitmap reader and writer (BMP, JPEG, PNG, TIFF, and HD Photo), and various texture processing functions. This is intended primarily for tool usage.

The library assumes that the client code will have already called CoInitialize, CoInitializeEx, or Windows::Foundation::Initialize as needed by the application before calling any DirectXTex routines

Headers

The majority of the header files here are intended for internal implementation of the library only (BC.h, DDS.h, DirectXTexP.h, and scoped.h). Only DirectXTex.h (and DirectXTex.inl) is meant as a 'public' header for the library.

Namespace

All the functions in the library are in the DirectX C++ namespace.

Functions

DDS I/O Functions

TGA I/O Functions

WIC I/O Functions

Texture Functions

Direct3D 11 Helper Functions

Utility Functions

Structures

TexMetadata contains metadata information about the texture resource and organization such as width, height, depth, format, dimension, etc.
  • TEX_DIMENSION_TEXTURE1D, TEX_DIMENSION_TEXTURE2D, and TEX_DIMENSION_TEXTURE3D are alises for D3D10_RESOURCE_DIMEMSION and D3D11_RESOURCE_DIMENSION.
  • TEX_MISC_TEXTURECUBE is an alias for the same D3D10_RESOURCE_MISC_FLAG and D3D11_RESOURCE_MISC_FLAG.
  • TEX_MISC2_ALPHA_MODE_MASK is a mask for miscFlags2 to obtain the TEX_ALPHA_MODE.
Image contains information about the surface including width, height, format, rowPitch, slicePitch, and a pointer to pixel data. Note that for 1D and 2D images, slicePitch should be set to the full size of the image.

ScratchImage is a helper class that manages memory for functions that return a Image or set of Images.

Blob is a helper class that manages for functions that return a binary blob of data.

Rect contains a simple pixel-based rectangle used by the CopyRectangle function.

Adding to a VS solution

In your application's solution, right-click on the Solution and use "Add \ Existing Project..." to add the appropriate .vcxproj file to your solution.
  • DirectXTex_Desktop_2015 is for Windows desktop applications building with VS 2015.
  • DirectXTex_Desktop_2013 is for Windows desktop applications building with VS 2013 Express for Desktop, VS 2013 Community, VS 2013 Professional or higher.
  • DirectXTex_Desktop_2012 is for Windows desktop applications building with VS 2012 Express for Desktop, VS 2012 Professional or higher
  • DirectXTex_Desktop_2010 is for Windows desktop applications building with VS 2010 using the Windows 8.1 SDK
  • DirectXTex_Windows10 is for universal Windows apps building with VS 2015 targeting Windows 10
  • DirectXTex_Windows81 is for Windows Store apps building with VS 2013 targeting Windows 8.1
  • DirectXTex_Windows8 is for Windows Store apps building with VS 2012 targeting Windows 8
  • DirectXTex_WindowsPhone81 is for Windows phone 8.1 apps building with VS 2013 Update 2 or later.
  • DirectXTex_XboxOneXDK is for Xbox One exclusive apps building with VS 2012 using the Xbox One XDK
  • DirectXTex_XboxOneADK is for Xbox One hub apps building with VS 2012 using the Xbox One ADK
In your application's project, right-click on the Project and use "References...", then "Add New Reference...", and then check the DirectXTex project name and click OK. For a Windows Store app, Windows phone, or Xbox One solution, you need to set Reference Assembly Output to false since DirectXTex is a static C++ library and not a WinRT component.

In your application's project settings, on the "C++ / General" page set Configuration to "All Configurations", set Platform to "All Platforms", and then add the relative path to DirectXTex;--assuming you have the DirectXTex folder in the same directory as your sln file, it should be $(SolutionDir$)\DirectXTex;--to the Additional Include Directories properties. Click Apply.

When using VS 2010 with the Windows 8.1 SDK http://go.microsoft.com/fwlink/?LinkID=323507, you'll need to apply the correct .props files to your projects as well as use the correct DirectXTex project. http://blogs.msdn.com/b/vcblog/archive/2012/11/23/using-the-windows-8-sdk-with-visual-studio-2010-configuring-multiple-projects.aspx

http://blogs.msdn.com/b/vcblog/archive/2010/05/03/flexible-project-to-project-references.aspx

Note: DirectXTex is not supported on Windows Phone 8.0, because WIC is not available on that platform. The .DDS files it generates are suitable for use on Windows Phone 8.x assuming the pixel format is supported by the device (currently Feature Level 9.3).

Release Notes

  • The alpha mode specification for DDS files was updated between the March 2013 and April 2013 releases. Any DDS files created using the DDS_FLAGS_FORCE_DX10_EXT_MISC2 flag or the texconv -dx10 switch using the March 2013 release should be refreshed.
  • Due to the underlying Windows BMP WIC codec, alpha channels are not supported for 16bpp or 32bpp BMP pixel format files. The Windows 8 version of the Windows BMP WIC codec does support 32bpp pixel formats with alpha when using the BITMAPV5HEADER file header.
  • While DXGI 1.0 and DXGI 1.1 include 5:6:5 (DXGI_FORMAT_B5G6R5_UNORM) and 5:5:5:1 (DXGI_FORMAT_B5G5R5A1_UNORM) pixel format enumerations, the DirectX 10.x and 11.0 Runtimes do not support these formats for use with Direct3D. The DirectX 11.1 runtime, DXGI 1.2, and the WDDM 1.2 driver model fully support 16bpp formats (5:6:5, 5:5:5:1, and 4:4:4:4).
  • Loading of 96bpp floating-point TIFF files results in a corrupted image prior to Windows 8. This fix is available on Windows 7 SP1 with KB 2670838 installed.

Updated Wiki: Texconv

$
0
0
This DirectXTex sample is an implementation of the texconv command-line texture utility from the DirectX SDK utilizing DirectXTex rather than D3DX. This tool loads an image and prepares it for runtime use by resizing, format conversion, mip-map generation, block-compression, and writes the result in a file format suited for runtime use.

To create cubemaps, volume maps, or texture arrays from individual files, use Texassemble

Syntax

Texconv.exe uses the following command syntax:

texconv [-w number] [-h number] [-m number] [-f format] [-if filter] [-srgb | -srgbi | -srgbo] [-px  string] [-sx string] [-o directory] [-ft file-type] [-hflip] [-vflip] [-sepalpha] [-wrap | -mirror] [-pmalpha] [-fl feature-level] [-pow2] [-tu | -tf] [-dword] [-xlum] [-dx10]  [-nologo] [-singleproc] [-nogpu] [-aw number] [-nmap flags] [-nmapamp number] <file-name(s)>
The file-name parameter indicates the file(s) to convert.

The optional command-line switches are described in the following table.

Optional Switches Description

  • -wnumber Width of the output texture in pixels.
  • -hnumber Height of the output texture in pixels.
  • -mnumber Number of mipmap levels to generate in the output texture. This setting only applies to DDS output.
  • -fformat Output format. Specify the DXGI format without the DXGI_FORMAT_ prefix (i.e. "-f BC1_UNORM").
  • -iffilter Image filter. Use one of the following: POINT, LINEAR, CUBIC, FANT, BOX, TRIANGLE, POINT_DITHER, LINEAR_DITHER, CUBIC_DITHER, FANT_DITHER, BOX_DITHER, TRIANGLE_DITHER, POINT_DITHER_DIFFUSION, LINEAR_DITHER_DIFFUSION, CUBIC_DITHER_DIFFUSION, FANT_DITHER_DIFFUSION, BOX_DITHER_DIFFUSION, or TRIANGLE_DITHER_DIFFUSION. Filters with DITHER in their name indicate that the 4x4 ordered dither algorithm, while "DITHER_DIFFUSION" is error diffusion dithering.
  • -srgb, -srgbi, or -srgbo Use sRGB if both the input and output data are in the sRGB color format (ie. gamma ~2.2). Use sRGBi if only the input is in sRGB; use sRGBo if only the output is in sRGB.
  • -pxstring Text string to attach to the front of the resulting texture's name.
  • -sxstring Text string to attach to the end of the resulting texture's name.
  • -odirectory Output directory.
  • -ftfile-type A file type for the output texture. Use one of the following: bmp, dds, jpg, png, or tiff. The default value is dds.
  • -hflip Perform horizonal flip of image
  • -vflip Perform horizonal flip of image
  • -sepalpha Separates alpha channel for resize/mipmap generation. This implies an alpha mode setting of DDS_ALPHA_MODE_CUSTOM as this is typically only used if the alpha channel doesn't contain transparency information.
  • -wrap, -mirror Sets the texture addressing mode for filtering to wrap or mirror, otherwise defaults to clamp.
  • -pmalpha Converts the final texture data to use premultiplied alpha. This sets an alpha mode of DDS_ALPHA_MODE_PREMULTIPLIED unless the entire alpha channel is fully opaque.
  • -pow2 Fits each texture to a power-of-2 for width & height, minimizing changes to the aspect ratio.
  • -flfeature-level Sets the target feature level which determines the maximum supported texture size. Defaults to "11.0" which is 16834, the limit for 11.0 and 11.1 Feature Level hardware.
  • -tu DDS files with TYPELESS formats are treated as UNORM
  • -tf DDS files with TYPELESS formats are treated as FLOAT
  • -dword For DDS files use a DWORD alignment instead of BYTE alignment (used for some legacy files)
  • -xlum DDS files with L8, A8L8, or L16 formats are expanded to 8:8:8:8 or 16:16:16:16
  • -dx10 Forces DDS file output to always use the "DX10" header extension, and allows the writing of alpha mode metadata information. The resulting file may not be compatible with the legacy D3DX10 or D3DX11 libraries.
  • -nologo Suppress copyright message.
  • -singleproc If the DirectXTex library and the texconv utility are built with OpenMP enabled, by default the tool will use multi-threading for CPU-based compression of BC6H and BC7 formats to spread the compression work across multiple cores. This flag disables this behavior forcing it to remain on a single core.
  • -nogpu When compressing BC6H / BC7 content, texconv will use DirectCompute on the GPU if available. Use of this flag forces texconv to always use the software codec instead.
  • -awnumber Provides an alpha weighting to use with the error metric for the BC7 GPU compressor. Defaults to 1.0.
  • -nmapflags Indicates conversion from a height-map to a normal-map. The flags is a combination of one or more of the following, and must have one of r, g, b, a, or l:
    • r Use the red channel of the input as the height
    • g Use the green channel of the input as the height
    • b Use the blue channel of the input as the height
    • a Use the alpha channel of the input as the height
    • l Use the luminance computed from red, green, and blue channels of the input as the height
    • m Use mirroring in U & V. Defaults to wrap when doing the central difference computation.
    • u Use mirroring in U. Defaults to wrap when doing the central difference computation.
    • v Use mirroring in V. Defaults to wrap when doing the central difference computation.
    • i Invert sign of the computed normal
    • o Compute a rough occlusion term and encode it into the alpha channel of the output.
  • -nmapampnumber Indicates an amplitude for the normal map, which defaults to 1.

Examples

Open a Command Prompt, and change to the directory containing Texconv.exe (i.e. ...\DirectXTex\Texconv\Release)
http://windows.microsoft.com/en-us/windows/command-prompt-faq

Enter the following command-line after changing to the appropriate directory:
texconv -pow2 -f BC1_UNORM cat.jpg 

This loads a JPEG image 'cat.jpg', resizes the image to a power of 2 in each dimension (if the original was 512 x 683 it is resized to 256 x 512), mipmaps are generated, the file is converted to BC1_UNORM (aka DXT1) block compression, and written out as 'cat.dds'.

texconv -nmap lo -nmapamp 2 -f R8G8B8A8_UNORM heightmap.png

This loads the PNG image 'heightmap.png', converts it to a normal-map using luminance and an amplitude of 2, and writes the data out as a 'heightmap.dds' with mipmaps and an occlusion term in the alpha channel using the R8G8B8A8_UNORM format.

Source code checked in, #b86f3faf6d12e25610cc41b1dea6e5636a6fd229

Updated Wiki: Resources

$
0
0

Presentations

Gamefest 2011 - Presentation Modern Texture Content Pipelines
http://www.microsoft.com/download/en/details.aspx?id=27853

Gamefest 2010 - Block Compression Smorgasbord
http://download.microsoft.com/download/D/8/D/D8D077EF-CB8C-4CCA-BC24-F2CDE3F91FAA/Block_Compression_Smorgasbord_US.zip

Blog posts

DirectX SDK and Games for Windows Blog
http://blogs.msdn.com/b/chuckw/archive/2015/04/18/github.aspx

http://blogs.msdn.com/b/chuckw/archive/2014/07/31/codeplex-july-2014-refresh.aspx

http://blogs.msdn.com/b/chuckw/archive/2013/10/29/codeplex-vs-2013-refresh.aspx

http://blogs.msdn.com/b/chuckw/archive/2013/08/15/directxtex-and-effects-11-update.aspx

http://blogs.msdn.com/b/chuckw/archive/2013/06/15/directxtex-update.aspx

http://blogs.msdn.com/b/chuckw/archive/2011/10/28/directxtex.aspx

http://blogs.msdn.com/b/chuckw/archive/2012/05/04/direct3d-11-textures-and-block-compression.aspx

http://blogs.msdn.com/b/chuckw/archive/2012/11/19/windows-imaging-component-and-windows-8.aspx

http://blogs.msdn.com/b/chuckw/archive/2013/10/18/visual-studio-2013-and-windows-8-1-sdk-rtm-are-now-available.aspx

http://blogs.msdn.com/b/chuckw/archive/2012/08/15/visual-studio-2012-and-windows-8-0-sdk-rtm-are-now-available.aspx

http://blogs.msdn.com/b/chuckw/archive/2010/02/05/the-dds-file-format-lives.aspx

MSDN

DDS Programmer's Guide
http://msdn.microsoft.com/en-us/library/bb943991.aspx

Block compression

http://msdn.microsoft.com/en-us/library/bb204843.aspx

http://msdn.microsoft.com/en-us/library/bb694531.aspx

http://msdn.microsoft.com/en-us/library/windows/desktop/hh308955.aspx

http://www.reedbeta.com/blog/2012/02/12/understanding-bcn-texture-compression-formats/

BC1, BC2, and BC3 use the S3 Texture Compression (S3TC) algorithm
http://en.wikipedia.org/wiki/S3_Texture_Compression

BC4 is the 3Dc+ algorithm, BC5 is 3Dc algorithm originally developed by ATI
http://en.wikipedia.org/wiki/3Dc

BC6H and BC7 use the BPTC algorithm originally developed by NVIDIA
http://developer.download.nvidia.com/opengl/specs/GL_ARB_texture_compression_bptc.txt

'Fast Block Compression' schemes
BC1 & BC3 algorithm from "Real-Time DXT Compression" by JMP van Waveren
http://www.nvidia.com/object/real-time-ycocg-dxt-compression.html
http://software.intel.com/en-us/articles/fast-cpu-dxt-compression

BC5 algorithm from "Real-Time Normal Map DXT Compression" by JMP van Waveren & Ignacio Castaño
http://www.nvidia.com/object/real-time-normal-map-dxt-compression.html

BC6H
https://software.intel.com/en-us/articles/fast-ispc-texture-compressor-update

BC7
http://software.intel.com/en-us/articles/fast-ispc-texture-compressor
http://gamma.cs.unc.edu/FasTC/

Gamma correct rendering

http://molecularmusings.wordpress.com/2011/11/21/gamma-correct-rendering/

http://filmicgames.com/archives/299

http://en.wikipedia.org/wiki/Gamma_correction

http://http.developer.nvidia.com/GPUGems3/gpugems3_ch24.html

Samples

http://go.microsoft.com/fwlink/?LinkId=254494

Related KB articles

http://support.microsoft.com/kb/2670838


Updated Wiki: Resources

$
0
0

Presentations

Gamefest 2011 - Presentation Modern Texture Content Pipelines
http://www.microsoft.com/download/en/details.aspx?id=27853

Gamefest 2010 - Block Compression Smorgasbord
http://download.microsoft.com/download/D/8/D/D8D077EF-CB8C-4CCA-BC24-F2CDE3F91FAA/Block_Compression_Smorgasbord_US.zip

Blog posts

DirectX SDK and Games for Windows Blog
http://blogs.msdn.com/b/chuckw/archive/2015/04/18/github.aspx

http://blogs.msdn.com/b/chuckw/archive/2014/07/31/codeplex-july-2014-refresh.aspx

http://blogs.msdn.com/b/chuckw/archive/2013/10/29/codeplex-vs-2013-refresh.aspx

http://blogs.msdn.com/b/chuckw/archive/2013/08/15/directxtex-and-effects-11-update.aspx

http://blogs.msdn.com/b/chuckw/archive/2013/06/15/directxtex-update.aspx

http://blogs.msdn.com/b/chuckw/archive/2011/10/28/directxtex.aspx

http://blogs.msdn.com/b/chuckw/archive/2012/05/04/direct3d-11-textures-and-block-compression.aspx

http://blogs.msdn.com/b/chuckw/archive/2012/11/19/windows-imaging-component-and-windows-8.aspx

http://blogs.msdn.com/b/chuckw/archive/2013/10/18/visual-studio-2013-and-windows-8-1-sdk-rtm-are-now-available.aspx

http://blogs.msdn.com/b/chuckw/archive/2012/08/15/visual-studio-2012-and-windows-8-0-sdk-rtm-are-now-available.aspx

http://blogs.msdn.com/b/chuckw/archive/2010/02/05/the-dds-file-format-lives.aspx

MSDN

DDS Programmer's Guide
http://msdn.microsoft.com/en-us/library/bb943991.aspx

Block compression

http://msdn.microsoft.com/en-us/library/bb204843.aspx

http://msdn.microsoft.com/en-us/library/bb694531.aspx

http://msdn.microsoft.com/en-us/library/windows/desktop/hh308955.aspx

http://www.reedbeta.com/blog/2012/02/12/understanding-bcn-texture-compression-formats/

BC1, BC2, and BC3 use the S3 Texture Compression (S3TC) algorithm
http://en.wikipedia.org/wiki/S3_Texture_Compression

BC4 is the 3Dc+ algorithm, BC5 is 3Dc algorithm originally developed by ATI
http://en.wikipedia.org/wiki/3Dc

BC6H and BC7 use the BPTC algorithm originally developed by NVIDIA
http://developer.download.nvidia.com/opengl/specs/GL_ARB_texture_compression_bptc.txt

'Fast Block Compression' schemes

BC1 & BC3 algorithm from "Real-Time DXT Compression" by JMP van Waveren
http://www.nvidia.com/object/real-time-ycocg-dxt-compression.html
http://software.intel.com/en-us/articles/fast-cpu-dxt-compression

BC5 algorithm from "Real-Time Normal Map DXT Compression" by JMP van Waveren & Ignacio Castaño
http://www.nvidia.com/object/real-time-normal-map-dxt-compression.html

Intel ISPC Compressors

BC6H
https://software.intel.com/en-us/articles/fast-ispc-texture-compressor-update

BC7
http://software.intel.com/en-us/articles/fast-ispc-texture-compressor
http://gamma.cs.unc.edu/FasTC/

Gamma correct rendering

http://molecularmusings.wordpress.com/2011/11/21/gamma-correct-rendering/

http://filmicgames.com/archives/299

http://en.wikipedia.org/wiki/Gamma_correction

http://http.developer.nvidia.com/GPUGems3/gpugems3_ch24.html

Samples

http://go.microsoft.com/fwlink/?LinkId=254494

Related KB articles

http://support.microsoft.com/kb/2670838

Updated Wiki: Resources

$
0
0

Presentations

Gamefest 2011 - Presentation Modern Texture Content Pipelines
http://www.microsoft.com/download/en/details.aspx?id=27853

Gamefest 2010 - Block Compression Smorgasbord
http://download.microsoft.com/download/D/8/D/D8D077EF-CB8C-4CCA-BC24-F2CDE3F91FAA/Block_Compression_Smorgasbord_US.zip

Blog posts

DirectX SDK and Games for Windows Blog
http://blogs.msdn.com/b/chuckw/archive/2015/04/18/github.aspx

http://blogs.msdn.com/b/chuckw/archive/2014/07/31/codeplex-july-2014-refresh.aspx

http://blogs.msdn.com/b/chuckw/archive/2013/10/29/codeplex-vs-2013-refresh.aspx

http://blogs.msdn.com/b/chuckw/archive/2013/08/15/directxtex-and-effects-11-update.aspx

http://blogs.msdn.com/b/chuckw/archive/2013/06/15/directxtex-update.aspx

http://blogs.msdn.com/b/chuckw/archive/2011/10/28/directxtex.aspx

http://blogs.msdn.com/b/chuckw/archive/2012/05/04/direct3d-11-textures-and-block-compression.aspx

http://blogs.msdn.com/b/chuckw/archive/2012/11/19/windows-imaging-component-and-windows-8.aspx

http://blogs.msdn.com/b/chuckw/archive/2013/10/18/visual-studio-2013-and-windows-8-1-sdk-rtm-are-now-available.aspx

http://blogs.msdn.com/b/chuckw/archive/2012/08/15/visual-studio-2012-and-windows-8-0-sdk-rtm-are-now-available.aspx

http://blogs.msdn.com/b/chuckw/archive/2010/02/05/the-dds-file-format-lives.aspx

MSDN

DDS Programmer's Guide
http://msdn.microsoft.com/en-us/library/bb943991.aspx

http://msdn.microsoft.com/en-us/library/bb204843.aspx

http://msdn.microsoft.com/en-us/library/bb694531.aspx

http://msdn.microsoft.com/en-us/library/windows/desktop/hh308955.aspx

Block compression

http://www.reedbeta.com/blog/2012/02/12/understanding-bcn-texture-compression-formats/

BC1, BC2, and BC3 use the S3 Texture Compression (S3TC) algorithm
http://en.wikipedia.org/wiki/S3_Texture_Compression

BC4 is the 3Dc+ algorithm, BC5 is 3Dc algorithm originally developed by ATI
http://en.wikipedia.org/wiki/3Dc

BC6H and BC7 use the BPTC algorithm originally developed by NVIDIA
http://developer.download.nvidia.com/opengl/specs/GL_ARB_texture_compression_bptc.txt

'Fast Block Compression' schemes

BC1 & BC3 algorithm from "Real-Time DXT Compression" by JMP van Waveren
http://www.nvidia.com/object/real-time-ycocg-dxt-compression.html
http://software.intel.com/en-us/articles/fast-cpu-dxt-compression

BC5 algorithm from "Real-Time Normal Map DXT Compression" by JMP van Waveren & Ignacio Castaño
http://www.nvidia.com/object/real-time-normal-map-dxt-compression.html

Intel ISPC Compressors

BC6H
https://software.intel.com/en-us/articles/fast-ispc-texture-compressor-update

BC7
http://software.intel.com/en-us/articles/fast-ispc-texture-compressor
http://gamma.cs.unc.edu/FasTC/

Gamma correct rendering

http://molecularmusings.wordpress.com/2011/11/21/gamma-correct-rendering/

http://filmicgames.com/archives/299

http://en.wikipedia.org/wiki/Gamma_correction

http://http.developer.nvidia.com/GPUGems3/gpugems3_ch24.html

Samples

http://go.microsoft.com/fwlink/?LinkId=254494

Related KB articles

http://support.microsoft.com/kb/2670838

Updated Release: March 2015 (Mar 27, 2015)

$
0
0
March 27, 2015
  • Added projects for Windows apps Technical Preview
  • Fixed bug with WIC-based mipmap generation for non-WIC supported formats
  • Fixed bug with WIC multiframe loader when resizing required
  • texconv: Added -nmap/-nmapamp for generating normal maps from height maps
  • texconv/texassemble: Updated to load multiframe WIC files (tiff, gif)
  • Minor code cleanup

DirectXTex is now licensed under the MIT license rather than the MS-PL

This version has a hotfix applied since the original April 14, 2015 release.

Released: March 2015 (Mar 27, 2015)

$
0
0
March 27, 2015
  • Added projects for Windows apps Technical Preview
  • Fixed bug with WIC-based mipmap generation for non-WIC supported formats
  • Fixed bug with WIC multiframe loader when resizing required
  • texconv: Added -nmap/-nmapamp for generating normal maps from height maps
  • texconv/texassemble: Updated to load multiframe WIC files (tiff, gif)
  • Minor code cleanup

DirectXTex is now licensed under the MIT license rather than the MS-PL

Updated Release: March 2015 (Mar 27, 2015)

$
0
0
March 27, 2015
  • Added projects for Windows apps Technical Preview
  • Fixed bug with WIC-based mipmap generation for non-WIC supported formats
  • Fixed bug with WIC multiframe loader when resizing required
  • texconv: Added -nmap/-nmapamp for generating normal maps from height maps
  • texconv/texassemble: Updated to load multiframe WIC files (tiff, gif)
  • Minor code cleanup

DirectXTex is now licensed under the MIT license rather than the MS-PL

Source code checked in, #429b3e7995495b57e2ef1302ad46aecf17b0da14

$
0
0
BC7 compressor optimization for skipping mode 0 & 2 by default

Source code checked in, #69190b2a7ddd9bf2fdf44ad599299887d1b25ddd

$
0
0
Removed WPO setting for static library

Updated Wiki: Home

$
0
0
NEWS: This project is also hosted on GitHubhttps://github.com/Microsoft/DirectXTex

http://go.microsoft.com/fwlink/?LinkId=248926

Project Description
DirectXTex, a shared source library for reading and writing DDS files, and performing various texture content processing operations including resizing, format conversion, mip-map generation, block compression for Direct3D runtime texture resources, and height-map to normal-map conversion. This library makes use of the Windows Image Component (WIC) APIs. It also includes a simple .TGA reader and writer since this image file format is commonly used for texture content processing pipelines, but is not currently supported by a built-in WIC codec.

Supported platforms:
  • Windows Store apps for Windows 8.1 / RT 8.1
  • Windows Store apps for Windows 8 / RT 8
  • Windows 8.x Win32 desktop
  • Windows Phone 8.1
  • Windows 7
  • Windows Vista
  • Windows Server equivalents of the above
  • Xbox One
Xbox One XDK developers: See the xtexconv sample which also includes some auxiliary platform-specific functionality for XDK development on the Microsoft Game Developer Network site https://developer.xboxlive.com/en-us/platform/development/education/Pages/Samples.aspx

Contributions
The DirectXTex contributors list will remain closed to ensure high-quality and focused feature set, but we are very interested in any bug-fixes, optimizations, additional features, or other community feedback on this library. Please use the Issue Tracker and feel free to attach code to the issue as needed. Note that any code contributed or released for the DirectXTex project is subject to the MS-PL.

windows8logo.jpg
windowsphone8logo.jpg
xboxonelogo.png

Commented Feature: DXTex rewrite using DirectXTex [651]

$
0
0
The legacy DirectX SDK included the DirectX Texture Tool (DXTEX.EXE), a venerable MFC-based application for viewing all the various components of a DDS file, doing conversions, and creating more complex surfaces in an interactive manner. This tool suffers from numerous issues including no support for "modern" .DDS files, Direct3D 9 only, uses legacy D3DX9, etc.
 
A new tool should be created that replicates all the existing functionality using DirectXTex including full support for "DX10' DDS files; BC4, BC5, BC6H, and BC7 compression; texture arrays; and height-map to normal map conversions.
Comments: So it's been 3 years, and getting time to do a full rewrite myself is unlikely. I'm thinking it's time to just hack up the original MFC Direct3D 9 version to just remove D3DX9 use in favor of DirectXTex...

Created Feature: Support for DirectX 12 [1329]

$
0
0
Need to add overloads or DirectX 12 for:

* CreateTexture
* CreateShaderResourceView
* CaptureTexture

Edited Feature: DXTex rewrite using DirectXTex [651]

$
0
0
The legacy DirectX SDK included the DirectX Texture Tool (DXTEX.EXE), a venerable MFC-based application for viewing all the various components of a DDS file, doing conversions, and creating more complex surfaces in an interactive manner. This tool suffers from numerous issues including no support for "modern" .DDS files, Direct3D 9 only, uses legacy D3DX9, etc.
 
A new tool should be created that replicates all the existing functionality using DirectXTex including full support for "DX10' DDS files; BC4, BC5, BC6H, and BC7 compression; texture arrays; and height-map to normal map conversions.

Commented Feature: DXTex rewrite using DirectXTex [651]

$
0
0
The legacy DirectX SDK included the DirectX Texture Tool (DXTEX.EXE), a venerable MFC-based application for viewing all the various components of a DDS file, doing conversions, and creating more complex surfaces in an interactive manner. This tool suffers from numerous issues including no support for "modern" .DDS files, Direct3D 9 only, uses legacy D3DX9, etc.
 
A new tool should be created that replicates all the existing functionality using DirectXTex including full support for "DX10' DDS files; BC4, BC5, BC6H, and BC7 compression; texture arrays; and height-map to normal map conversions.
Comments: Let's do it :) In the case you need a beta tester, I am happy to help ! Good news in any case. Thanks for that !
Viewing all 1174 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>