27 using SiliconStudio.Core.Serialization.Converters;
28 using SiliconStudio.Paradox.Games;
29 using SiliconStudio.Core;
31 namespace SiliconStudio.
Paradox.Graphics
36 [
DataConverter(AutoGenerate =
false, ContentReference =
true, DataType =
false)]
91 return New(device, width, height, depth,
false, format, textureFlags, usage);
110 return new Texture3D(device, NewDescription(width, height, depth, format, textureFlags, mipCount, usage));
131 return New(device, width, height, depth, 1,
format,
new[] { GetDataBox(
format, width, height, depth, textureData, (IntPtr)Interop.Fixed(textureData)) }, textureFlags, usage);
151 return new Texture3D(device, NewDescription(width, height, depth, format, textureFlags, mipCount, usage), textureData);
164 if (image == null)
throw new ArgumentNullException(
"image");
166 throw new ArgumentException(
"Invalid image. Must be 3D",
"image");
168 return new Texture3D(device, CreateTextureDescriptionFromImage(image, textureFlags, usage), image.
ToDataBox());
182 var texture = Texture.Load(device, stream, textureFlags, usage);
184 throw new ArgumentException(
string.Format(
"Texture is not type of [Texture3D] but [{0}]", texture.GetType().Name));
185 return (Texture3D)texture;
197 MipLevels = CalculateMipMapCount(mipCount, width, height, depth),
198 Usage = GetUsageWithFlags(usage, flags),
200 Dimension = TextureDimension.Texture3D,
201 Level = MSAALevel.None
static TextureDescription NewDescription(int width, int height, int depth, PixelFormat format, TextureFlags flags, int mipCount, GraphicsResourceUsage usage)
override Texture ToStaging()
Return an equivalent staging texture CPU read-writable from this instance.
static new Texture3D Load(GraphicsDevice device, Stream stream, TextureFlags textureFlags=TextureFlags.ShaderResource, GraphicsResourceUsage usage=GraphicsResourceUsage.Immutable)
Loads a 3D texture from a stream.
A simple wrapper to specify number of mipmaps. Set to true to specify all mipmaps or sets an integer ...
_In_ size_t _In_ DXGI_FORMAT _In_ size_t _In_ DXGI_FORMAT _In_ DWORD flags
Provides method to instantiate an image 1D/2D/3D supporting TextureArray and mipmaps on the CPU or to...
Base class for converters to/from a data type.
static Texture3D New(GraphicsDevice device, int width, int height, int depth, PixelFormat format, TextureFlags textureFlags=TextureFlags.ShaderResource, GraphicsResourceUsage usage=GraphicsResourceUsage.Default)
Creates a new Texture3D with a single mipmap.
GraphicsResourceUsage
Identifies expected resource use during rendering. The usage directly reflects whether a resource is ...
ImageDescription Description
Description of this image.
TextureDimension
Defines the dimension of a texture.
Performs primitive-based rendering, creates resources, handles system-level variables, adjusts gamma ramp levels, and creates shaders. See The+GraphicsDevice+class to learn more about the class.
Flags
Enumeration of the new Assimp's flags.
A Common description for all textures.
override Texture Clone()
Makes a copy of this texture.
A Texture 3D frontend to SharpDX.Direct3D11.Texture3D.
static new Texture3D New(GraphicsDevice device, Image image, TextureFlags textureFlags=TextureFlags.ShaderResource, GraphicsResourceUsage usage=GraphicsResourceUsage.Immutable)
Creates a new Texture3D directly from an Image.
static Texture3D New(GraphicsDevice device, int width, int height, int depth, MipMapCount mipCount, PixelFormat format, DataBox[] textureData, TextureFlags textureFlags=TextureFlags.ShaderResource, GraphicsResourceUsage usage=GraphicsResourceUsage.Default)
Creates a new Texture3D.
DataBox[] ToDataBox()
Gets the databox from this image.
Provides access to data organized in 3D.
static Texture3D New(GraphicsDevice device, int width, int height, int depth, MipMapCount mipCount, PixelFormat format, TextureFlags textureFlags=TextureFlags.ShaderResource, GraphicsResourceUsage usage=GraphicsResourceUsage.Default)
Creates a new Texture3D.
_In_ size_t _In_ size_t _In_ DXGI_FORMAT format
PixelFormat
Defines various types of pixel formats.
static Texture3D New(GraphicsDevice device, TextureDescription texture)
Creates a new texture from a Direct3D11.Texture3D.
TextureDimension Dimension
The dimension of a texture.
Base class for texture resources.