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

    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;

    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?

  • \$\begingroup\$ Have you tried existing ones? \$\endgroup\$ – Sidar Aug 7 '17 at 16:51
  • \$\begingroup\$ @Sidar I have not found any pre-made .dds cubemaps, but I have created multiple myself with two different tools (DxTex and NVIDIA tools for Photoshop), both produce the same issue. \$\endgroup\$ – user Aug 7 '17 at 17:02
  • \$\begingroup\$ I understood you made them yourself, so to make sure that your code is ok try existing ones first if you can find any though. Do they have to be dds? \$\endgroup\$ – Sidar Aug 7 '17 at 18:02
  • \$\begingroup\$ @Sidar Yeah I understood what you were getting at but I couldn't find any pre-made .dds files. For my setup, yes they have to be dds \$\endgroup\$ – user Aug 7 '17 at 18:39
  • \$\begingroup\$ Even turned existing skyboxes to dds? \$\endgroup\$ – Sidar Aug 7 '17 at 18:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.