I need to be able to compile an ".hlsl, .fx" shader in my DirectX app. The issue is that, with the code below, I can only specify 6 textures by their default path directory.
I don't want this - I want to be able to set one path to the directory containing all of my textures, then compile my shader and see the shader effect on all those 50 textures.
I am using DirectX June 2010 and using Direct3D11 and Visual Studio 2015.
#define NUM_TEXTURES 7
DETAIL_TESSELLATION_TEXTURE_STRUCT DetailTessellationTextures[NUM_TEXTURES +
1] =
{
// DiffuseMap NormalHeightMap DisplayName,
fHeightScale fBaseTextureRepeat fDensityScale fMeaningfulDifference
{ L"Textures\\rocks.jpg", L"Textures\\rocks_NM_height.dds", L"Rocks",
10.0f, 1.0f, 25.0f, 2.0f/255.0f },
{ L"Textures\\stones.bmp", L"Textures\\stones_NM_height.dds", L"Stones",
5.0f, 1.0f, 10.0f, 5.0f/255.0f },
{ L"Textures\\wall.jpg", L"Textures\\wall_NM_height.dds", L"Wall",
8.0f, 1.0f, 7.0f, 7.0f/255.0f },
{ L"Textures\\wood.jpg", L"Textures\\four_NM_height.dds", L"Four
shapes", 30.0f, 1.0f, 35.0f, 2.0f/255.0f },
{ L"Textures\\concrete.bmp", L"Textures\\bump_NM_height.dds", L"Bump",
10.0f, 4.0f, 50.0f, 2.0f/255.0f },
{ L"Textures\\concrete.bmp", L"Textures\\dent_NM_height.dds", L"Dent",
10.0f, 4.0f, 50.0f, 2.0f/255.0f },
{ L"Textures\\wood.jpg", L"Textures\\saint_NM_height.dds", L"Saints" ,
20.0f, 1.0f, 40.0f, 2.0f/255.0f },
{ L"", L"", L"Custom" ,
5.0f, 1.0f, 10.0f, 2.0f/255.0f },
};
DWORD g_dwNumTextures = 0;
ID3D11ShaderResourceView*
g_pDetailTessellationBaseTextureRV[NUM_TEXTURES+1];
ID3D11ShaderResourceView*
g_pDetailTessellationHeightTextureRV[NUM_TEXTURES+1];
ID3D11ShaderResourceView*
g_pDetailTessellationDensityTextureRV[NUM_TEXTURES+1];
ID3D11ShaderResourceView* g_pLightTextureRV = NULL;
WCHAR
g_pszCustomTextureDiffuseFilename[MAX_PATH] = L"";
WCHAR
g_pszCustomTextureNormalHeightFilename[MAX_PATH] = L"";
DWORD g_bRecreateCustomTextureDensityMap =
false;