I'm trying to implement a skybox into my engine, and I'm having some trouble loading the image as a cube map. Everything works (but it doesn't look right) if I don't load using an ImageLoadInformation struct in the ShaderResourceView.FromFile() method, but it breaks if I do.
I need to, of course, because I need to tell SlimDX to load it as a cubemap. How can I fix this?
Here is my new loading code after the "fix":
public static void LoadCubeTexture(string filename)
{
ImageLoadInformation loadInfo = new ImageLoadInformation()
{
BindFlags = BindFlags.ShaderResource,
CpuAccessFlags = CpuAccessFlags.None,
Depth = 32,
FilterFlags = FilterFlags.None,
FirstMipLevel = 0,
Format = SlimDX.DXGI.Format.B8G8R8A8_UNorm,
Height = 512,
MipFilterFlags = FilterFlags.Linear,
MipLevels = 1,
OptionFlags = ResourceOptionFlags.TextureCube,
Usage = ResourceUsage.Default,
Width = 512
};
textures.Add(filename, ShaderResourceView.FromFile(Graphics.device, "Resources/" + filename, loadInfo));
}
Each of the faces of my cube texture are 512x512.