在DX 12 VC ++中从图像创建纹理 [英] Creating a texture from a image in DX 12 VC++

查看:155
本文介绍了在DX 12 VC ++中从图像创建纹理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只想知道Directx 12 API从图像创建纹理.

I just want know Directx 12 API to create texture from image.

对于DX11,它是D3DX11CreateShaderResourceViewFromFile,对于DX9,它是D3DXCreateTextureFromFileEx,对于DX12?

For DX11 it is D3DX11CreateShaderResourceViewFromFile and for DX9 it is D3DXCreateTextureFromFileEx and for DX12 ?

推荐答案

到目前为止,情况已有所改善.微软重写了DX12的DDSTextureLoader,并将其作为其MiniEngine的一部分发布在GitHub上 https://github.com/Microsoft/DirectX -Graphics-Samples/blob/master/MiniEngine/Core/DDSTextureLoader.cpp

Things are a little bit better by now. Microsoft rewrote their DDSTextureLoader for DX12 and released it as part of their MiniEngine on GitHub https://github.com/Microsoft/DirectX-Graphics-Samples/blob/master/MiniEngine/Core/DDSTextureLoader.cpp

您可能还想看看我的衍生作品,该作品旨在在MiniEngine之外使DDSTextureLoader的使用更加容易. https://github.com/ClemensX/ShadedPath12/blob/master/ShadedPath12/ShadedPath12/DDSTextureLoader.cpp

You also may want to take a look at my derivative work that is intended to make use of the DDSTextureLoader a bit easier outside of MiniEngine. https://github.com/ClemensX/ShadedPath12/blob/master/ShadedPath12/ShadedPath12/DDSTextureLoader.cpp

我将所有我的纹理文件都使用此加载器.它可以很好地解析DDS(DirectDrawSurface)文件格式,包括mipmap.

I use this loader for all my texture files. It parses DDS (DirectDrawSurface) file format pretty well, including mipmaps.

这篇关于在DX 12 VC ++中从图像创建纹理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆