I am using the NVIDIA cubemap tool to generate my .dds file in Photoshop but I am unexpected results when the texture is loaded into my application.
I'm unsure as to whether this is caused by my code, or the texture generation in Photoshop. Does anyone know why this is happening?
The texture is being applied to a sphere and it seems to only be stretching down the centre of the sphere, the rest is ok.
The code I am using to generate the resource view
D3DX11_IMAGE_LOAD_INFO loadSMInfo; loadSMInfo.MiscFlags = D3D11_RESOURCE_MISC_TEXTURECUBE; loadSMInfo.BindFlags = D3DX11_DEFAULT; loadSMInfo.Depth = D3DX11_DEFAULT; loadSMInfo.Filter = D3DX11_DEFAULT; loadSMInfo.FirstMipLevel = D3DX11_DEFAULT; loadSMInfo.MipFilter = D3DX11_DEFAULT; loadSMInfo.MipLevels = D3DX11_DEFAULT; ID3D11Texture2D* SMTexture = 0; hr = D3DX11CreateTextureFromFile(_pd3dDevice, L"assets/textures/skybox/sky.dds", &loadSMInfo, 0, (ID3D11Resource**)&SMTexture, 0); D3D11_TEXTURE2D_DESC SMTextureDesc; SMTexture->GetDesc(&SMTextureDesc); D3D11_SHADER_RESOURCE_VIEW_DESC SMViewDesc; SMViewDesc.Format = SMTextureDesc.Format; SMViewDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURECUBE; SMViewDesc.TextureCube.MipLevels = SMTextureDesc.MipLevels; SMViewDesc.TextureCube.MostDetailedMip = 0; ID3D11ShaderResourceView * smrv; hr = _pd3dDevice->CreateShaderResourceView(SMTexture, &SMViewDesc, &fullcubemap);
Edit: I have changed the sphere to a cube and the texture is looking better quality on two of the faces, but the other faces are stretched and distorted. I'm going to try another texture.
Edit: I believe the problem is in my shader, forgetting to set the w value on the position to 1.0f.
Perhaps the only problem left is a wrong texture image?