Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17825

Multitexturing in DirectX11 - 3 textures work fine, but 4th turns black!

$
0
0
Trying to write a multitexturing shader in DirectX11 - 3 textures work fine, but adding 4th gets sampled as black! Could you please look at the textureClass.cpp line 79? - I'm guess its D3D11_TEXTURE2D_DESC settings are wrong, but no idea how to set it up right. I tried changing ArraySize from 1 to 4, but does nothing. If thats not the issue, please look at the LightShader_ps - maybe doing something wrong there? Otherwise, no idea. // Setup the description of the texture. textureDesc.Height = height; textureDesc.Width = width; textureDesc.MipLevels = 0; textureDesc.ArraySize = 1; textureDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; textureDesc.SampleDesc.Count = 1; textureDesc.SampleDesc.Quality = 0; textureDesc.Usage = D3D11_USAGE_DEFAULT; textureDesc.BindFlags = D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET; textureDesc.CPUAccessFlags = 0; textureDesc.MiscFlags = D3D11_RESOURCE_MISC_GENERATE_MIPS; Please help, thanks. https://github.com/mister51213/DirectX11Engine/blob/master/DirectX11Engine/Texture.cpp

Viewing all articles
Browse latest Browse all 17825

Trending Articles



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