<순수한 DirectX가아닌 https://github.com/microsoft/DirectXTex 깃허브에서 가져와서 활용하고있습니다>
SamplerState
화질을 확대했을때 계단현상이 생기는데 이것을 어떻게 처리할것인지 결정하는 State
Texture
ShaderResourceView 즉 SRV를 사용한다.
"ScratchImage" 구조체를 만들어서 이미지를 로드하게되는데
이미지는 DirectX에서 로드방법이 여러가지가 있다.
_splitpath_s 확장자를 가져오는 함수
_strupr_s 대문자로 바꿔주는 함수
HRESULT __cdecl LoadFromDDSFile(
_In_z_ const wchar_t* szFile,
_In_ DDS_FLAGS flags,
_Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image) noexcept;
이런 함수명으로 TGA, WIC 등 로드가 가능하다.
이렇게 이미지를 로드를 하고나서
HRESULT __cdecl CreateShaderResourceView(
_In_ ID3D11Device* pDevice, _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
_Outptr_ ID3D11ShaderResourceView** ppSRV) noexcept;
이 함수를 통해서 이 이미지의 SRV를 생성하게된다.
첫번째 인자부터 차례대로 Device, ScratchImage->GetImage(), ScratchImage->GetImageCount(),
ScratchImage->GetMetadata(), &SRV 이렇게 차례대로 넣어주면 된다.
'공부 > DirectX' 카테고리의 다른 글
| DirectX 인스턴싱 (0) | 2021.09.06 |
|---|---|
| 더블버퍼링, 스왑체인 (0) | 2021.09.06 |
| 파티클 구조 (0) | 2021.08.31 |
| DirectX 레스터라이저 (0) | 2021.08.17 |
| DirectX 스탠실 (3D에만 사용) (0) | 2021.08.17 |