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

Updated Wiki: GenerateMipMaps3D

$
0
0
Generates mipmaps for a 3D volume texture from a set of images representing the slices.

Note: This generates mipmaps for 3D dimension textures. For 1D and 2D dimension textures, see GenerateMipMaps.

HRESULT GenerateMipMaps3D( _In_reads_(depth) const Image* baseImages, _In_ size_t depth,
    _In_ DWORD filter, _In_ size_t levels,
    _Out_ ScratchImage& mipChain );

HRESULT GenerateMipMaps3D( _In_reads_(nimages) const Image* srcImages,
    _In_ size_t nimages, _In_ const TexMetadata& metadata,
    _In_ DWORD filter, _In_ size_t levels, _Out_ ScratchImage& mipChain );

Parameters

baseImages/srcImages: The mipmap chain is created by repeatedly down-sizing the slices of base images. The first level of the resulting mipChain is set to a copy of the input baseImages.

depth: The Z dimension of the volume texture which is also the number of slices in the baseImages array.

filter: See Filter Flags. Note that for non-power-of-2 depth volume maps, only TEX_FILTER_TRIANGLE will give the expected results. It therefore defaults to Triangle on this input, otherwise it defaults to Fant/Box.

levels: Number of mip map levels including base. A value of 0 indicates creating a full mipmap chain down to 1x1x1.

Example

ScratchImage baseImages;

...

ScratchImage mipChain;
hr = GenerateMipMaps3D( baseImages.GetImages(), baseImages.GetImageCount(), baseImages.GetMetadata(), TEX_FILTER_DEAFULT, 0, mipChain );
if ( FAILED(hr) )
    ...

Remarks

This function does not operate directly on block compressed images. See Decompress and Compress.

Each miplevel of a 3D volume texture is half the size in width & height and half the number of slices of the one above to a minimum of 1.

This function does not make use of WIC for resizing since volume textures require 3D filtering methods.

Note: All slices in a miplevel must be in contiguous memory for working with Direct3D 11, which is how ScratchImage is implemented.

Viewing all articles
Browse latest Browse all 1174

Latest Images

Trending Articles



Latest Images

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