XNA Creators Club Online
Page 1 of 1 (2 items)
Sort Posts: Previous Next

D3DX10CreateTextureFromFile and problems with 3D textures

Last post 10/26/2009 1:02 PM by n3Xus. 1 replies.
  • 10/24/2009 1:02 PM

    D3DX10CreateTextureFromFile and problems with 3D textures

    Hello,

    I'm using the D3DX10CreateShaderResourceViewFromFileA function to load a 3D texture from file but it's not working correctly. I've been using this function to load 3D textures in the past in another project and it worked fine...

    The problem is that all volume slices have the same texture as the 1st slice, but the mip maps look like they are made from the other texture (the one that should be as the 2nd slice, but isn't).

    I'm using Photoshop and nVidia's dds texture tool to make separate volume slices then I use the DxTex tool that comes with the DX SDK to make the volume texture.
     I've tried the texconvex.exe to convert the volume texture I made with dxTex tool to the "correct" format but it still doesn't work. Maybe the dxTex tool uses "old" format to store 3d textures (when I load the texture converted by the texconvex program there are some artifacts in the texture).

    Are there any other tools that can save a 3d texture to a dds format (the dds tool for photoshop by nvidia doesn't support it), there is the phoshop plugin that comes with the DX sdk but I have no idea how to export volume textures from it (I tried two layers as I though it will use them as depth layers for volume textures but it didn't work).

    Anyone had similar problems?

    I've also been trying to Map/Unmap the 3d texture without much success, both layers share the same texture(the textures is a 128x128x2, so I just made a simple loop to fill the 1st layer with values from 0-127 and the 2nd one with 128-255).

    Does anyone maybe have a sample of mapping a 3d texture?


  • 10/26/2009 1:02 PM In reply to

    Re: D3DX10CreateTextureFromFile and problems with 3D textures

    I found the solution: I forgot to specify the addressing mode of the texture in the texture sampler :S
Page 1 of 1 (2 items) Previous Next