[SlimDX] Loading a Texture3D
Does anyone know how to populate a Texture3D from a series of 2D images? I have a series of PNG images which together form the 3D texture, but I have no idea how to load these with SlimDX.
Any help would be appreciated.
1.Set up an byte[] array in length of (image files)*(pixels count for each file).
2.Starting a loop that reads each image and write each pixel to the byte array by the order.(nested loops of images-vertical-horizontal)
3.Call to Texture3D.FromMemory(device, dataArray).
This is it! I haven't test it but it should work.
2.Starting a loop that reads each image and write each pixel to the byte array by the order.(nested loops of images-vertical-horizontal)
3.Call to Texture3D.FromMemory(device, dataArray).
This is it! I haven't test it but it should work.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement