Before writingCodePreviously, we made a DDS file. I found a picture on the Internet, processed it as 512*512, and saved it as JPG.
After Microsoft's DirectX texture tool is started, drag the image to it:
Select the file format-> Generate MIP maps. You can see the word MIP 1 of 10 in the title bar of the image. This is because the size of the original image is 512*512, 256*256,128*128 ,..., 1*1. A series of subsampled images, plus 10 original images in total.
We can use the up/down flip key to view these images.
We know that d3d11 contains BC1, BC2 ,..., Bc6 and bc7 are supported in a total of 7 texture compression formats. texture images are usually large. If the compression format is not used, loading will take up a lot of bandwidth.
Now we select format-> change surface format. We can see some compression formats, such as dxt1, dxt2 ,..., Dxt5: these formats are actually d3d9 compression formats. dxt1 corresponds to BC1, dxt2, and dxt3 corresponds to BC2, dxt4, and dxt5 correspond to bc3.
Select the dxt5 format and save the file as the DDS format.