Beispiel #1
0
 internal VkTexture(
     VkGraphicsDevice gd,
     uint width,
     uint height,
     uint mipLevels,
     uint arrayLayers,
     VkFormat vkFormat,
     TextureUsage usage,
     TextureSampleCount sampleCount,
     VkImage existingImage)
 {
     Debug.Assert(width > 0 && height > 0);
     _gd           = gd;
     MipLevels     = mipLevels;
     Width         = width;
     Height        = height;
     Depth         = 1;
     VkFormat      = vkFormat;
     Format        = VkFormats.VkToVdPixelFormat(VkFormat);
     ArrayLayers   = arrayLayers;
     Usage         = usage;
     SampleCount   = sampleCount;
     VkSampleCount = VkFormats.VdToVkSampleCount(sampleCount);
     _optimalImage = existingImage;
 }
Beispiel #2
0
        public static ResourceFlags Convert(TextureUsage usage, PixelFormat format)
        {
            var flags = ResourceFlags.None;

            if ((usage & TextureUsage.ShaderRead) == 0)
            {
                flags |= ResourceFlags.DenyShaderResource;
            }

            if ((usage & TextureUsage.ShaderWrite) != 0)
            {
                flags |= ResourceFlags.AllowUnorderedAccess;
            }

            if ((usage & TextureUsage.RenderTarget) != 0)
            {
                if (!PixelFormatUtil.IsDepthStencilFormat(format))
                {
                    flags |= ResourceFlags.AllowRenderTarget;
                }
                else
                {
                    flags |= ResourceFlags.AllowDepthStencil;
                }
            }

            return(flags);
        }
Beispiel #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TypelessTexture2D"/> class.
        /// </summary>
        /// <param name="usage">The usage.</param>
        /// <param name="textureUsage">The texture usage.</param>
        /// <param name="fmt">The FMT.</param>
        /// <param name="width">The width.</param>
        /// <param name="height">The height.</param>
        /// <param name="dp">The dp.</param>
        public TypelessTexture2D(GraphicsDevice device, Usage usage, TextureUsage textureUsage,
                                 CPUAccess cpuAccess, PixelFormat fmt, uint width, uint height, uint mipmaps,
                                 uint sampleCount, uint sampleQuality, GraphicsLocality locality, byte[][] data)
            : base(usage, textureUsage, cpuAccess, locality)
        {
            Validate(mipmaps, width, height);
            this.width       = width;
            this.height      = height;
            this.format      = fmt;
            this.mipmapCount = mipmaps == 0 ? Images.MipmapHelper.MipmapCount(width, height) : mipmaps;

            // We create driver part.
            if (locality != GraphicsLocality.SystemMemoryOnly)
            {
                this.device     = device;
                this.driverPart = device.DriverDevice.CreateTexture2D(usage, fmt.CommonFormatLayout,
                                                                      CPUAccess, width, height, mipmaps, textureUsage, sampleCount, sampleQuality, data);
            }

            // We may need to create sw part.
            if (locality == GraphicsLocality.DeviceAndSystemMemory ||
                locality == GraphicsLocality.SystemMemoryOnly)
            {
                this.swData = data;
            }
        }
Beispiel #4
0
 public Texture CreateManual(string name, string group, TextureType type, int width, int height, int numMipmaps,
                             PixelFormat format, TextureUsage usage, IManualResourceLoader loader,
                             bool hwGammaCorrection, int fsaa, string fsaaHint)
 {
     return(CreateManual(name, group, type, width, height, 1, numMipmaps, format, usage, loader, hwGammaCorrection, fsaa,
                         string.Empty));
 }
Beispiel #5
0
 private static Usage GetUsage(TextureUsage usage)
 {
     return(usage switch
     {
         TextureUsage.Sampler => Usage.Diffuse,
         TextureUsage.Sampler0 => Usage.Diffuse,
         TextureUsage.Sampler1 => Usage.Diffuse,
         TextureUsage.SamplerCatchlight => Usage.Catchlight,
         TextureUsage.SamplerColorMap0 => Usage.Diffuse,
         TextureUsage.SamplerColorMap1 => Usage.Diffuse,
         TextureUsage.SamplerDiffuse => Usage.Diffuse,
         TextureUsage.SamplerEnvMap => Usage.Envmap,
         TextureUsage.SamplerMask => Usage.Mask,
         TextureUsage.SamplerNormal => Usage.Normal,
         TextureUsage.SamplerNormalMap0 => Usage.Normal,
         TextureUsage.SamplerNormalMap1 => Usage.Normal,
         TextureUsage.SamplerReflection => Usage.Reflection,
         TextureUsage.SamplerSpecular => Usage.Specular,
         TextureUsage.SamplerSpecularMap0 => Usage.Specular,
         TextureUsage.SamplerSpecularMap1 => Usage.Specular,
         TextureUsage.SamplerWaveMap => Usage.Wave,
         TextureUsage.SamplerWaveletMap0 => Usage.Wave,
         TextureUsage.SamplerWaveletMap1 => Usage.Wave,
         TextureUsage.SamplerWhitecapMap => Usage.Whitecap,
         _ => throw new ArgumentOutOfRangeException(nameof(usage), usage, null)
     });
 public override void SetTexture(TextureUsage usage, Texture texture)
 {
     if (usage == TextureUsage.Detail)
     {
         DetailTexture = texture as Texture2D;
     }
 }
Beispiel #7
0
        // Used to construct Swapchain textures.
        internal VkTexture(
            VkGraphicsDevice gd,
            uint width,
            uint height,
            uint mipLevels,
            uint arrayLayers,
            VkFormat vkFormat,
            TextureUsage usage,
            TextureSampleCount sampleCount,
            VkImage existingImage)
        {
            Debug.Assert(width > 0 && height > 0);
            _gd           = gd;
            MipLevels     = mipLevels;
            _width        = width;
            _height       = height;
            _depth        = 1;
            VkFormat      = vkFormat;
            _format       = VkFormats.VkToVdPixelFormat(VkFormat);
            ArrayLayers   = arrayLayers;
            Usage         = usage;
            Type          = TextureType.Texture2D;
            SampleCount   = sampleCount;
            VkSampleCount = VkFormats.VdToVkSampleCount(sampleCount);
            _optimalImage = existingImage;
            _imageLayouts = new[] { VkImageLayout.Undefined };

            ClearIfRenderTarget();
        }
 public override void SetTexture(TextureUsage usage, Texture texture)
 {
     if (usage == TextureUsage.Specular)
     {
         SpecularMap = texture as Texture2D;
     }
 }
Beispiel #9
0
 public override void SetTexture(TextureUsage textureUsage, Texture texture)
 {
     if (textureUsage == TextureUsage.Bloom)
     {
         GraphicsDevice.Textures[1] = texture;
     }
 }
Beispiel #10
0
 public override void SetTexture(TextureUsage usage, Texture texture)
 {
     if (usage == TextureUsage.NormalMap)
     {
         NormalMap = texture as Texture2D;
     }
 }
Beispiel #11
0
 public override void SetTexture(TextureUsage usage, Texture texture)
 {
     if (usage == TextureUsage.Dual)
     {
         Texture2 = texture as Texture2D;
     }
 }
Beispiel #12
0
        internal static bool IsFormatSupported(PixelFormat format, TextureUsage usage, MTLFeatureSupport metalFeatures)
        {
            switch (format)
            {
            case PixelFormat.BC1_Rgb_UNorm:
            case PixelFormat.BC1_Rgba_UNorm:
            case PixelFormat.BC2_UNorm:
            case PixelFormat.BC3_UNorm:
                return(metalFeatures.IsSupported(MTLFeatureSet.macOS_GPUFamily1_v1) ||
                       metalFeatures.IsSupported(MTLFeatureSet.macOS_GPUFamily1_v2) ||
                       metalFeatures.IsSupported(MTLFeatureSet.macOS_GPUFamily1_v3));

            case PixelFormat.ETC2_R8_G8_B8_UNorm:
            case PixelFormat.ETC2_R8_G8_B8_A1_UNorm:
            case PixelFormat.ETC2_R8_G8_B8_A8_UNorm:
                return(metalFeatures.IsSupported(MTLFeatureSet.iOS_GPUFamily1_v1) ||
                       metalFeatures.IsSupported(MTLFeatureSet.iOS_GPUFamily2_v1) ||
                       metalFeatures.IsSupported(MTLFeatureSet.iOS_GPUFamily3_v1) ||
                       metalFeatures.IsSupported(MTLFeatureSet.iOS_GPUFamily4_v1));

            case PixelFormat.R16_UNorm:
                return(((usage & TextureUsage.DepthStencil) == 0) ||
                       metalFeatures.IsSupported(MTLFeatureSet.macOS_GPUFamily1_v2) ||
                       metalFeatures.IsSupported(MTLFeatureSet.macOS_GPUFamily1_v3));

            default:
                return(true);
            }
        }
Beispiel #13
0
        public static BindFlags ToDirectX(this TextureUsage usage, PixelFormat format)
        {
            var bindFlags = BindFlags.None;

            if ((usage & TextureUsage.ShaderRead) != 0)
            {
                bindFlags |= BindFlags.ShaderResource;
            }

            if ((usage & TextureUsage.ShaderWrite) != 0)
            {
                bindFlags |= BindFlags.UnorderedAccess;
            }

            if ((usage & TextureUsage.RenderTarget) != 0)
            {
                if (!PixelFormatUtil.IsDepthStencilFormat(format))
                {
                    bindFlags |= BindFlags.RenderTarget;
                }
                else
                {
                    bindFlags |= BindFlags.DepthStencil;
                }
            }

            return(bindFlags);
        }
Beispiel #14
0
        internal static VkImageUsageFlags VdToVkTextureUsage(TextureUsage vdUsage)
        {
            VkImageUsageFlags vkUsage = VkImageUsageFlags.None;

            vkUsage = VkImageUsageFlags.TransferDst | VkImageUsageFlags.TransferSrc;
            bool isDepthStencil = (vdUsage & TextureUsage.DepthStencil) == TextureUsage.DepthStencil;

            if ((vdUsage & TextureUsage.Sampled) == TextureUsage.Sampled)
            {
                vkUsage |= VkImageUsageFlags.Sampled;
            }
            if (isDepthStencil)
            {
                vkUsage |= VkImageUsageFlags.DepthStencilAttachment;
            }
            if ((vdUsage & TextureUsage.RenderTarget) == TextureUsage.RenderTarget)
            {
                vkUsage |= VkImageUsageFlags.ColorAttachment;
            }
            if ((vdUsage & TextureUsage.Storage) == TextureUsage.Storage)
            {
                vkUsage |= VkImageUsageFlags.Storage;
            }

            return(vkUsage);
        }
Beispiel #15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Texture"/> class.
 /// </summary>
 /// <param name="usage">The usage.</param>
 /// <param name="texUsage">The texture usage.</param>
 public TypelessTexture(Usage usage, TextureUsage texUsage, CPUAccess cpuAccess, GraphicsLocality locality)
 {
     this.usage     = usage;
     textureUsage   = texUsage;
     this.locality  = locality;
     this.cpuAccess = cpuAccess;
 }
Beispiel #16
0
        internal static TextureUsage GetVdUsage(BindFlags bindFlags, CpuAccessFlags cpuFlags, ResourceOptionFlags optionFlags)
        {
            TextureUsage usage = 0;

            if ((bindFlags & BindFlags.RenderTarget) != 0)
            {
                usage |= TextureUsage.RenderTarget;
            }
            if ((bindFlags & BindFlags.DepthStencil) != 0)
            {
                usage |= TextureUsage.DepthStencil;
            }
            if ((bindFlags & BindFlags.ShaderResource) != 0)
            {
                usage |= TextureUsage.Sampled;
            }
            if ((bindFlags & BindFlags.UnorderedAccess) != 0)
            {
                usage |= TextureUsage.Storage;
            }

            if ((optionFlags & ResourceOptionFlags.TextureCube) != 0)
            {
                usage |= TextureUsage.Cubemap;
            }
            if ((optionFlags & ResourceOptionFlags.GenerateMipMaps) != 0)
            {
                usage |= TextureUsage.GenerateMipmaps;
            }

            return(usage);
        }
 public override void SetTexture(TextureUsage usage, Texture texture)
 {
     if (usage == TextureUsage.Emissive)
     {
         EmissiveMap = texture as Texture2D;
     }
 }
Beispiel #18
0
        /// <summary>
        /// Create new instance of <see cref="TextureDescriptor"/> struct describing 2D texture.
        /// </summary>
        /// <param name="width">The width</param>
        /// <param name="height">The height</param>
        /// <param name="mipMap">Whether to compute mip levels from width and height, otherwise 1.</param>
        /// <param name="arrayLayers">The array layers count.</param>
        /// <param name="format">The <see cref="PixelFormat"/></param>
        /// <param name="textureUsage">The texture usage.</param>
        /// <param name="samples">The number of samples.</param>
        /// <returns></returns>
        public static TextureDescriptor Texture2D(
            int width,
            int height,
            bool mipMap,
            int arrayLayers           = 1,
            PixelFormat format        = PixelFormat.RGBA8UNorm,
            TextureUsage textureUsage = TextureUsage.ShaderRead,
            SampleCount samples       = SampleCount.Count1)
        {
            int mipLevels = 1;

            if (mipMap)
            {
                while (height > 1 || width > 1)
                {
                    ++mipLevels;

                    if (height > 1)
                    {
                        height >>= 1;
                    }

                    if (width > 1)
                    {
                        width >>= 1;
                    }
                }
            }

            width       = Math.Max(width, 1);
            height      = Math.Max(height, 1);
            arrayLayers = Math.Max(arrayLayers, 1);

            return(new TextureDescriptor(TextureType.Texture2D, width, height, 1, mipLevels, arrayLayers, format, textureUsage, samples));
        }
Beispiel #19
0
 /// <summary>
 /// Creates a new Texture instance without resolving any game data.
 /// </summary>
 /// <param name="parent">The Material this Texture has been instantiated for.</param>
 /// <param name="raw">The <see cref="TextureUsage"/> this Texture is input for.</param>
 /// <param name="texturePath">The path to this Texture.</param>
 public Texture(Material parent, TextureUsage raw, string texturePath)
 {
     Parent             = parent;
     TextureUsageRaw    = raw;
     TextureUsageSimple = GetUsage(raw);
     TexturePath        = texturePath;
 }
Beispiel #20
0
        public Texture CreateDeviceTexture(GraphicsDevice gd, ResourceFactory rf, TextureUsage usage)
        {
            IsDirty = false;
            var texture = _texture.CreateDeviceTexture(gd, rf);

            texture.Name = "T_" + Name;
            return(texture);
        }
        /// <summary>
        /// <para>Specifies if the texture will be used as a render target attachment.</para>
        /// <para>If the texture is potentially rendered into, it may require a different memory layout, which needs to
        /// be known during construction.</para>
        /// </summary>
        /// <param name="usage">Defaults to <see cref="TextureUsage.Default"/>; c.f.
        /// <see cref="TextureUsage.ColorAttachment"/>.</param>
        /// <returns>This Builder, for chaining calls.</returns>
        public TextureBuilder WithUsage(TextureUsage usage)
        {
            ThrowExceptionIfDisposed();

            Native.TextureBuilder.Usage(NativePtr, (byte)usage);

            return(this);
        }
Beispiel #22
0
        public static unsafe Texture CreateSimpleTexture <T>(GraphicsDevice gd, TextureUsage usage, IReadOnlyTexture <T> texture) where T : unmanaged
        {
            if (gd == null)
            {
                throw new ArgumentNullException(nameof(gd));
            }
            if (texture == null)
            {
                throw new ArgumentNullException(nameof(texture));
            }

            var  pixelFormat = GetFormat(typeof(T));
            bool mip         = (usage & TextureUsage.GenerateMipmaps) != 0;
            uint mipLevels   = mip ? MipLevelCount(texture.Width, texture.Height) : 1;

            using Texture staging = gd.ResourceFactory.CreateTexture(new TextureDescription(
                                                                         (uint)texture.Width, (uint)texture.Height, 1,
                                                                         mipLevels,
                                                                         1,
                                                                         pixelFormat,
                                                                         TextureUsage.Staging,
                                                                         TextureType.Texture2D));

            staging.Name = "T_" + texture.Name + "_Staging";

            var buffer = texture.PixelData;

            fixed(T *texDataPtr = &buffer[0])
            {
                gd.UpdateTexture(
                    staging, (IntPtr)texDataPtr, (uint)(buffer.Length * Unsafe.SizeOf <T>()),
                    0, 0, 0,
                    (uint)texture.Width, (uint)texture.Height, 1,
                    0, 0);
            }

            Texture veldridTexture = gd.ResourceFactory.CreateTexture(new TextureDescription(
                                                                          (uint)texture.Width, (uint)texture.Height, 1,
                                                                          mipLevels,
                                                                          1,
                                                                          pixelFormat,
                                                                          usage,
                                                                          TextureType.Texture2D));

            veldridTexture.Name = "T_" + texture.Name;

            using CommandList cl = gd.ResourceFactory.CreateCommandList();
            cl.Begin();
            cl.CopyTexture(staging, veldridTexture);
            if (mip)
            {
                cl.GenerateMipmaps(veldridTexture);
            }
            cl.End();
            gd.SubmitCommands(cl);

            return(veldridTexture);
        }
Beispiel #23
0
        /// <summary>
        /// Sets the texture based on the texture usage.
        /// </summary>
        public override void SetTexture(TextureUsage textureUsage, Texture texture)
        {
            var count = materialParts.Count;

            for (int i = 0; i < count; ++i)
            {
                materialParts[i].SetTexture(textureUsage, texture);
            }
        }
Beispiel #24
0
 /// <summary>
 /// Create a new filled texture with the given dimensions and format.
 /// </summary>
 /// <param name="width">The width of the texture.</param>
 /// <param name="format">The texel format.</param>
 /// <param name="data">The initial texture data. Must be large enough to fill entire texture.</param>
 /// <param name="usage">The texture usage policy.</param>
 public Texture1D(uint width, TexelFormat format, void *data, TextureUsage usage = TextureUsage.Static)
     : base(width, 1, 1, 1, 1, format, usage, ResourceType.Texture1D)
 {
     if (data == null)
     {
         throw new ArgumentException("Initial texture data pointer cannot be null", nameof(data));
     }
     SetDataImpl(data, new(0, 0, 0, width, 1, 1, 0, 1));
 }
Beispiel #25
0
        /// <summary>
        /// Creates a new blank cubemap texture.
        /// </summary>
        /// <param name="size">Width & height of a single cubemap face in pixels.</param>
        /// <param name="format">Format of the pixels.</param>
        /// <param name="usage">Describes planned texture use.</param>
        /// <param name="hasMipmaps">Should the texture allocate memory for the entire mip-map chain or only the top level.
        ///                          </param>
        /// <param name="gammaCorrection">If true the texture data is assumed to have be gamma corrected and will be
        ///                               converted back to linear space when sampled on GPU, and converted to gamma space
        ///                               before being written by the GPU.</param>
        public static Texture CreateCube(uint size, PixelFormat format = PixelFormat.RGBA8,
                                         TextureUsage usage            = TextureUsage.Default, bool hasMipmaps = false, bool gammaCorrection = false)
        {
            Texture texture = new Texture(true);

            Internal_create(texture, format, size, size, 1, TextureType.TextureCube, usage, 1,
                            hasMipmaps, gammaCorrection);

            return(texture);
        }
Beispiel #26
0
        /// <summary>
        /// Creates a new blank 3D texture.
        /// </summary>
        /// <param name="width">Width of the texture in pixels.</param>
        /// <param name="height">Height of the texture in pixels.</param>
        /// <param name="depth">Depth of the texture in pixels.</param>
        /// <param name="format">Format of the pixels.</param>
        /// <param name="usage">Describes planned texture use.</param>
        /// <param name="hasMipmaps">Should the texture allocate memory for the entire mip-map chain or only the top level.
        ///                          </param>
        public static Texture Create3D(uint width, uint height, uint depth, PixelFormat format = PixelFormat.RGBA8,
                                       TextureUsage usage = TextureUsage.Default, bool hasMipmaps = false)
        {
            Texture texture = new Texture(true);

            Internal_create(texture, format, width, height, depth, TextureType.Texture3D, usage, 1,
                            hasMipmaps, false);

            return(texture);
        }
Beispiel #27
0
        /// <summary>
        /// Creates a new blank 2D texture.
        /// </summary>
        /// <param name="width">Width of the texture in pixels.</param>
        /// <param name="height">Height of the texture in pixels.</param>
        /// <param name="format">Format of the pixels.</param>
        /// <param name="usage">Describes planned texture use.</param>
        /// <param name="numSamples">If higher than 1, texture containing multiple samples per pixel is created.</param>
        /// <param name="hasMipmaps">Should the texture allocate memory for the entire mip-map chain or only the top level.
        ///                          </param>
        /// <param name="gammaCorrection">If true the texture data is assumed to have be gamma corrected and will be
        ///                               converted back to linear space when sampled on GPU, and converted to gamma space
        ///                               before being written by the GPU.</param>
        public static Texture Create2D(uint width, uint height, PixelFormat format = PixelFormat.RGBA8,
                                       TextureUsage usage   = TextureUsage.Default, uint numSamples = 1, bool hasMipmaps = false,
                                       bool gammaCorrection = false)
        {
            Texture texture = new Texture(true);

            Internal_create(texture, format, width, height, 1, TextureType.Texture2D, usage, numSamples,
                            hasMipmaps, gammaCorrection);

            return(texture);
        }
Beispiel #28
0
        public Texture2D(GraphicsDevice graphicsDevice, int width, int height, int numberLevels,
                         TextureUsage usage, SurfaceFormat format)
        {
            this.device         = graphicsDevice;
            this.width          = width;
            this.height         = height;
            this.numberOfLevels = numberLevels;
            this.textureUsage   = usage;
            this.surfaceFormat  = format;

            initGL();
        }
Beispiel #29
0
 public TextureCreationParameters(int width, int height, int depth, int mipLevels, SurfaceFormat format,
                                  TextureUsage textureUsage, Color colorKey, FilterOptions filter, FilterOptions mipFilter)
 {
     m_Width     = width;
     m_Height    = height;
     m_Depth     = depth;
     m_MipLevels = mipLevels;
     m_Format    = format;
     m_ColorKey  = colorKey;
     m_Filter    = filter;
     m_MipFilter = mipFilter;
 }
Beispiel #30
0
 public OpenGLPlaceholderTexture(
     uint width,
     uint height,
     PixelFormat format,
     TextureUsage usage,
     TextureSampleCount sampleCount)
 {
     _width      = width;
     _height     = height;
     Format      = format;
     Usage       = usage;
     SampleCount = sampleCount;
 }
Beispiel #31
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="graphicsDevice"></param>
        /// <param name="width"></param>
        /// <param name="height"></param>
        /// <param name="usage"></param>
        public Texture(GraphicsDevice graphicsDevice, int width, int height, TextureUsage usage)
            : base()
        {
            if (graphicsDevice == null)
                throw new ArgumentNullException("graphicsDevice");

            graphicsDevice.EnsureDeviceCreated();

            this.Width = width;
            this.Height = height;
            this.Usage = usage;

            this.CalculateInternalSize(graphicsDevice);

            this.InternalTexture = D3DHelper.CreateTexture(graphicsDevice.InternalDevice, this.InternalWidth, this.InternalHeight, this.Usage);
        }
		public override Axiom.Media.PixelFormat GetNativeFormat( TextureType ttype, PixelFormat format, TextureUsage usage )
		{
			// Basic filtering
			var d3dPF = D3D9Helper.ConvertEnum( D3D9Helper.GetClosestSupported( format ) );

			// Calculate usage
			var d3dusage = D3D9.Usage.None;
			var pool = D3D9.Pool.Managed;
			if ( ( usage & TextureUsage.RenderTarget ) != 0 )
			{
				d3dusage |= D3D9.Usage.RenderTarget;
				pool = D3D9.Pool.Default;
			}
			if ( ( usage & TextureUsage.Dynamic ) != 0 )
			{
				d3dusage |= D3D9.Usage.Dynamic;
				pool = D3D9.Pool.Default;
			}

			var curDevice = D3D9RenderSystem.ActiveD3D9Device;

			// Use D3DX to adjust pixel format
			switch ( ttype )
			{
				case TextureType.OneD:
				case TextureType.TwoD:
					var tReqs = D3D9.Texture.CheckRequirements( curDevice, 0, 0, 0, d3dusage, D3D9Helper.ConvertEnum( format ), pool );
					d3dPF = tReqs.Format;
					break;

				case TextureType.ThreeD:
					var volReqs = D3D9.VolumeTexture.CheckRequirements( curDevice, 0, 0, 0, 0, d3dusage,
					                                                    D3D9Helper.ConvertEnum( format ), pool );
					d3dPF = volReqs.Format;
					break;

				case TextureType.CubeMap:
					var cubeReqs = D3D9.CubeTexture.CheckRequirements( curDevice, 0, 0, d3dusage, D3D9Helper.ConvertEnum( format ),
					                                                   pool );
					d3dPF = cubeReqs.Format;
					break;
			}

			return D3D9Helper.ConvertEnum( d3dPF );
		}
Beispiel #33
0
		// This ends up just discarding the format passed in; the C# methods don't let you supply
		// a "recommended" format.  Ah well.
		public override Axiom.Media.PixelFormat GetNativeFormat( TextureType ttype, PixelFormat format, TextureUsage usage )
		{
			// Basic filtering
			D3D.Format d3dPF = D3DHelper.ConvertEnum( D3DHelper.GetClosestSupported( format ) );

			// Calculate usage
			D3D.Usage d3dusage = 0;
			D3D.Pool pool = D3D.Pool.Managed;
			if ( ( usage & TextureUsage.RenderTarget ) != 0 )
			{
				d3dusage |= D3D.Usage.RenderTarget;
				pool = D3D.Pool.Default;
			}
			if ( ( usage & TextureUsage.Dynamic ) != 0 )
			{
				d3dusage |= D3D.Usage.Dynamic;
				pool = D3D.Pool.Default;
			}

			// Use D3DX to adjust pixel format
			switch ( ttype )
			{
				case TextureType.OneD:
				case TextureType.TwoD:
					D3D.TextureRequirements tReqs = D3D.Texture.CheckRequirements( device, 0, 0, 0, d3dusage, D3DHelper.ConvertEnum( format ), pool );
					d3dPF = tReqs.Format;
					break;
				case TextureType.ThreeD:
					D3D.VolumeTextureRequirements volReqs = D3D.VolumeTexture.CheckRequirements( device, 0, 0, 0, 0, d3dusage, D3DHelper.ConvertEnum( format ), pool );
					d3dPF = volReqs.Format;
					break;
				case TextureType.CubeMap:
					D3D.CubeTextureRequirements cubeReqs = D3D.CubeTexture.CheckRequirements( device, 0, 0, d3dusage, D3DHelper.ConvertEnum( format ), pool );
					d3dPF = cubeReqs.Format;
					break;
			}
			return D3DHelper.ConvertEnum( d3dPF );
		}
Beispiel #34
0
        internal static D3D.Texture CreateTexture(D3D.Device device, int width, int height, TextureUsage usage)
        {
            D3D.Usage nativeUsage = D3D.Usage.None;
            D3D.Format nativeFormat = D3D.Format.A8R8G8B8;
            D3D.Pool nativePool = D3D.Pool.Managed;

            switch (usage)
            {
                case TextureUsage.RenderTarget:
                    nativeUsage = D3D.Usage.RenderTarget;
                    nativePool = D3D.Pool.Default;
                    break;
            }

            return new D3D.Texture(
                device,
                width,
                height,
                1,
                nativeUsage,
                nativeFormat,
                nativePool);
        }
        protected virtual void LoadImages(List<Image> images)
        {
            Debug.Assert(images.Count >= 1);
            if (isLoaded) {
                log.InfoFormat("Unloading image: {0}", name);
                Unload();
            }
            srcWidth = width = images[0].Width;
            srcHeight = height = images[0].Height;
            srcDepth = depth = images[0].Depth;
            if (hasAlpha && images[0].Format == PixelFormat.L8) {
                format = PixelFormat.A8;
                srcBpp = 8;
            } else {
                this.Format = images[0].Format;
            }
            if (finalBpp == 16) {
                switch (format) {
                    case PixelFormat.R8G8B8:
                    case PixelFormat.X8R8G8B8:
                        format = PixelFormat.R5G6B5;
                        break;
                    case PixelFormat.B8G8R8:
                    case PixelFormat.X8B8G8R8:
                        format = PixelFormat.B5G6R5;
                        break;
                    case PixelFormat.A8R8G8B8:
                    case PixelFormat.R8G8B8A8:
                    case PixelFormat.A8B8G8R8:
                    case PixelFormat.B8G8R8A8:
                        format = PixelFormat.A4R4G4B4;
                        break;
                    default:
                        // use the original format
                        break;
                }
            }

            // The custom mipmaps in the image have priority over everything
            int imageMips = images[0].NumMipMaps;
            if (imageMips > 0) {
                numMipmaps = imageMips;
                usage &= ~TextureUsage.AutoMipMap;
            }

            // Create the texture
            CreateInternalResources();

            // Check if we're loading one image with multiple faces
            // or a vector of images representing the faces
            int faces;
            bool multiImage; // Load from multiple images?
            if (images.Count > 1) {
                faces = images.Count;
                multiImage = true;
            } else {
                faces = images[0].NumFaces;
                multiImage = false;
            }

            // Check wether number of faces in images exceeds number of faces
            // in this texture. If so, clamp it.
            if (faces > this.NumFaces)
                faces = this.NumFaces;

            // Say what we're doing
            log.InfoFormat("Texture: {0}: Loading {1} faces({2},{3}x{4}x{5})",
                name, faces, PixelUtil.GetFormatName(images[0].Format),
                images[0].Width, images[0].Height, images[0].Depth);
            #if NOT // crazy ogre logging
            if (!(mMipmapsHardwareGenerated && mNumMipmaps == 0))
            str << mNumMipmaps;
            if(mUsage & TU_AUTOMIPMAP)
            {
            if (mMipmapsHardwareGenerated)
                str << " hardware";

            str << " generated mipmaps";
            }
            else
            {
            str << " custom mipmaps";
            }
             		if(multiImage)
            str << " from multiple Images.";
            else
            str << " from Image.";
            // Scoped
            {
            // Print data about first destination surface
            HardwarePixelBufferSharedPtr buf = getBuffer(0, 0);
            str << " Internal format is " << PixelUtil::getFormatName(buf->getFormat()) <<
            "," << buf->getWidth() << "x" << buf->getHeight() << "x" << buf->getDepth() << ".";
            }
            LogManager::getSingleton().logMessage(
                LML_NORMAL, str.str());
            #endif
            // Main loading loop
            // imageMips == 0 if the image has no custom mipmaps, otherwise contains the number of custom mips
            for (int mip = 0; mip <= imageMips; ++mip) {
                for (int i = 0; i < faces; ++i) {
                    PixelBox src;
                    if (multiImage) {
                        // Load from multiple images
                        src = images[i].GetPixelBox(0, mip);
                    } else {
                        // Load from faces of images[0]
                        src = images[0].GetPixelBox(i, mip);

                        if (hasAlpha && src.Format == PixelFormat.L8)
                            src.Format = PixelFormat.A8;
                    }

                    if (gamma != 1.0f) {
                        // Apply gamma correction
                        // Do not overwrite original image but do gamma correction in temporary buffer
                        IntPtr buffer = Marshal.AllocHGlobal(PixelUtil.GetMemorySize(src.Width, src.Height, src.Depth, src.Format));
                        try {
                            PixelBox corrected = new PixelBox(src.Width, src.Height, src.Depth, src.Format, buffer);
                            PixelUtil.BulkPixelConversion(src, corrected);

                            Image.ApplyGamma(corrected.Data, gamma, corrected.ConsecutiveSize, PixelUtil.GetNumElemBits(src.Format));

                            // Destination: entire texture. BlitFromMemory does the scaling to
                            // a power of two for us when needed
                            GetBuffer(i, mip).BlitFromMemory(corrected);
                        } finally {
                            Marshal.FreeHGlobal(buffer);
                        }
                    } else {
                        // Destination: entire texture. BlitFromMemory does the scaling to
                        // a power of two for us when needed
                        GetBuffer(i, mip).BlitFromMemory(src);
                    }
                }
            }
            // Update size (the final size, not including temp space)
            size = this.NumFaces * PixelUtil.GetMemorySize(width, height, depth, format);

            isLoaded = true;
        }
Beispiel #36
0
		public override bool IsHardwareFilteringSupported( TextureType ttype, PixelFormat format, TextureUsage usage,
														   bool preciseFormatOnly )
#endif
		{
			if ( format == PixelFormat.Unknown )
			{
				return false;
			}

			// Check natively format
			PixelFormat nativeFormat = GetNativeFormat( ttype, format, usage );
			if ( preciseFormatOnly && format != nativeFormat )
			{
				return false;
			}

			// Assume non-floating point is supported always
			if ( !PixelUtil.IsFloatingPoint( nativeFormat ) )
			{
				return true;
			}

			// Hack: there are no elegant GL API to detects texture filtering supported,
			// just hard code for cards based on vendor specifications.

			// TODO: Add cards that 16 bits floating point flitering supported by
			// hardware below
			String[] sFloat16SupportedCards = {
												// GeForce 8 Series
												"*GeForce*8800*", // GeForce 7 Series
												"*GeForce*7950*", "*GeForce*7900*", "*GeForce*7800*", "*GeForce*7600*",
												"*GeForce*7500*", "*GeForce*7300*", // GeForce 6 Series
												"*GeForce*6800*", "*GeForce*6700*", "*GeForce*6600*", "*GeForce*6500*",
												"*GeForce*6200*", "" // Empty string means end of list
											  };

			// TODO: Add cards that 32 bits floating point flitering supported by
			// hardware below
			String[] sFloat32SupportedCards = {
												// GeForce 8 Series
												"*GeForce*8800*", "" // Empty string means end of list
											  };

			PixelComponentType pct = PixelUtil.GetComponentType( nativeFormat );
			String[] supportedCards;
			switch ( pct )
			{
				case PixelComponentType.Float16:
					supportedCards = sFloat16SupportedCards;
					break;
				case PixelComponentType.Float32:
					supportedCards = sFloat32SupportedCards;
					break;
				default:
					return false;
			}
			String pcRenderer = Gl.glGetString( Gl.GL_RENDERER ); // TAO 2.0
			//String pcRenderer = Marshal.PtrToStringAnsi( Gl.glGetString( Gl.GL_RENDERER ) );

			foreach ( String str in supportedCards )
			{
				if ( str == pcRenderer )
				{
					return true;
				}
			}

			return false;
		}
Beispiel #37
0
 /// <summary>
 /// Creates a new blank cube texture.
 /// </summary>
 /// <param name="width">Width of a single face of the texture in pixels.</param>
 /// <param name="height">Height of a single face of the texture in pixels.</param>
 /// <param name="format">Format of the pixels.</param>
 /// <param name="usage">Describes planned texture use.</param>
 /// <param name="numSamples">If higher than 1, texture containing multiple samples per pixel is created.</param>
 /// <param name="hasMipmaps">Should the texture allocate memory for the entire mip-map chain or only the top level.
 ///                          </param>
 /// <param name="gammaCorrection">If true the texture data is assumed to have be gamma corrected and will be
 ///                               converted back to linear space when sampled on GPU, and converted to gamma space
 ///                               before being written by the GPU.</param>
 public TextureCube(PixelFormat format, int width, int height, TextureUsage usage = TextureUsage.Default,
     int numSamples = 1, bool hasMipmaps = false, bool gammaCorrection = false)
 {
     Internal_CreateInstance(this, format, width, height, usage, numSamples, hasMipmaps, gammaCorrection);
 }
Beispiel #38
0
 private static extern void Internal_CreateInstance(TextureCube instance, PixelFormat format, int width,
     int height, TextureUsage usage, int numSamples, bool hasMipmaps, bool gammaCorrection);
 /// <summary>
 ///    Creates a GL texture manually.
 /// </summary>
 /// <param name="name"></param>
 /// <param name="type"></param>
 /// <param name="width"></param>
 /// <param name="height"></param>
 /// <param name="numMipMaps"></param>
 /// <param name="format"></param>
 /// <param name="usage"></param>
 /// <returns></returns>
 public override Texture CreateManual(string name, TextureType type, int width, int height, int numMipMaps, Axiom.Media.PixelFormat format, TextureUsage usage)
 {
     GLTexture texture = new GLTexture(name, type, width, height, numMipMaps, format, usage);
     texture.Enable32Bit(is32Bit);
     return texture;
 }
Beispiel #40
0
 internal void CreateTexture(int _width, int _height, TextureResizeMode _resizeMode, TextureUsage _usage, PixelFormat _format)
 {
     ICall_createTexture_WidthSize(mInstance.Ptr, _width, _height, _resizeMode, _usage, _format);
 }
 public Texture CreateManual(string name, TextureType type, int width, int height, int numMipmaps, PixelFormat format, TextureUsage usage)
 {
     return CreateManual(name, type, width, height, 1, numMipmaps, format, usage);
 }
Beispiel #42
0
        public bool CheckDeviceFormat(DeviceType deviceType, SurfaceFormat adapterFormat, TextureUsage usage,
			QueryUsages queryUsages, ResourceType resourceType, SurfaceFormat checkFormat)
        {
            throw new NotImplementedException();
        }
Beispiel #43
0
		/// <see cref="Axiom.Core.TextureManager.IsHardwareFilteringSupported(TextureType, PixelFormat, TextureUsage, bool)"/>
#if NET_40
		public override bool IsHardwareFilteringSupported( TextureType ttype, PixelFormat format, TextureUsage usage, bool preciseFormatOnly = false )
Beispiel #44
0
        private bool CheckTextureFilteringSupported(TextureType ttype, PixelFormat format, TextureUsage usage)
        {
            // Gets D3D format
            var d3Dpf = D3DHelper.ConvertEnum(format);
            if (d3Dpf == Format.Unknown)
                return false;

            foreach (var currDevice in _deviceManager)
            {

                var currDevicePrimaryWindow = currDevice.PrimaryWindow;
                var pSurface = currDevicePrimaryWindow.RenderSurface;

                // Get surface desc
                var srfDesc = pSurface.Description;
            
                // Calculate usage
                
                var d3Dusage = Usage.QueryFilter;
                if ((usage & TextureUsage.RenderTarget) != 0)
                    d3Dusage |= Usage.RenderTarget;
                if ((usage & TextureUsage.Dynamic) != 0)
                    d3Dusage |= Usage.Dynamic;

                // Detect resource type
                ResourceType rtype;
                switch(ttype)
                {
                case TextureType.OneD:
                case TextureType.TwoD:
                    rtype = ResourceType.Texture;
                    break;
                case TextureType.ThreeD:
                    rtype = ResourceType.VolumeTexture;
                    break;
                case TextureType.CubeMap:
                    rtype = ResourceType.CubeTexture;
                    break;
                default:
                    return false;
                }


                var hr = _pD3D.CheckDeviceFormat(
                    currDevice.AdapterNumber,
                    currDevice.DeviceType,
                    srfDesc.Format,
                    d3Dusage,
                    rtype,
                    d3Dpf);

                if (!hr)
                    return false;
            }
        
            return true;    
        }
 public bool IsFormatSupported(TextureType ttype, PixelFormat format, TextureUsage usage)
 {
     return GetNativeFormat(ttype, format, usage) == format;
 }
 public bool IsEquivalentFormatSupported(TextureType ttype, PixelFormat format, TextureUsage usage)
 {
     PixelFormat supportedFormat = GetNativeFormat(ttype, format, usage);
     // Assume that same or greater number of bits means quality not degraded
     return PixelUtil.GetNumElemBits(supportedFormat) >= PixelUtil.GetNumElemBits(format);
 }
 public virtual PixelFormat GetNativeFormat(TextureType ttype, PixelFormat format,
                                            TextureUsage usage)
 {
     // Just throw an error, for non-overriders
     throw new NotImplementedException();
 }
		/// <summary>
		/// </summary>
		/// <param name="ttype"> </param>
		/// <param name="format"> </param>
		/// <param name="usage"> </param>
		/// <returns> </returns>
		public override Media.PixelFormat GetNativeFormat( TextureType ttype, Media.PixelFormat format, TextureUsage usage )
		{
			// Adjust requested parameters to capabilities
			RenderSystemCapabilities caps = Root.Instance.RenderSystem.HardwareCapabilities;
#warning check TextureCompressionVTC == RSC_TEXTURE_COMPRESSION_PVRTC
			// Check compressed texture support
			// if a compressed format not supported, revert to A8R8G8B8
			if ( PixelUtil.IsCompressed( format ) && !caps.HasCapability( Capabilities.TextureCompressionDXT ) && !caps.HasCapability( Capabilities.TextureCompressionVTC ) )
			{
				return Media.PixelFormat.A8R8G8B8;
			}
			// if floating point textures not supported, revert to A8R8G8B8
			if ( PixelUtil.IsFloatingPoint( format ) && !caps.HasCapability( Capabilities.TextureFloat ) )
			{
				return Media.PixelFormat.A8R8G8B8;
			}

			// Check if this is a valid rendertarget format
			if ( ( usage & TextureUsage.RenderTarget ) != 0 )
			{
				/// Get closest supported alternative
				/// If format is supported it's returned
				return GLESRTTManager.Instance.GetSupportedAlternative( format );
			}

			// Supported
			return format;
		}
Beispiel #49
0
 private static extern void ICall_createTexture_WidthSize(IntPtr widget_ptr, int _width, int _height, TextureResizeMode _resizeMode, TextureUsage _usage, PixelFormat _format);
 /// <summary>
 ///    Method for creating a new blank texture.
 /// </summary>
 /// <param name="name"></param>
 /// <param name="texType"></param>
 /// <param name="width"></param>
 /// <param name="height"></param>
 /// <param name="numMipMaps"></param>
 /// <param name="format"></param>
 /// <param name="usage"></param>
 /// <returns></returns>
 public Texture CreateManual(string name, TextureType texType, int width, int height, int depth, int numMipmaps, PixelFormat format, TextureUsage usage)
 {
     Texture ret = (Texture)Create(name, true);
     ret.TextureType = texType;
     ret.Width = width;
     ret.Height = height;
     ret.Depth = depth;
     ret.NumMipMaps = (numMipmaps == -1) ? defaultNumMipMaps : numMipmaps;
     ret.Format = format;
     ret.Usage = usage;
     ret.Enable32Bit(is32Bit);
     ret.CreateInternalResources();
     return ret;
 }
Beispiel #51
0
		public Texture CreateManual( string name, string group, TextureType type, int width, int height, int depth,
									 int numMipmaps, PixelFormat format, TextureUsage usage, IManualResourceLoader loader,
									 bool hwGammaCorrection, int fsaa )
		{
			return CreateManual( name, group, type, width, height, depth, numMipmaps, format, usage, loader, hwGammaCorrection, fsaa, string.Empty );
		}
Beispiel #52
0
		/// <see cref="IsHardwareFilteringSupported(TextureType, PixelFormat, TextureUsage, bool)"/>
		public bool IsHardwareFilteringSupported( TextureType ttype, PixelFormat format, TextureUsage usage )
		{
			return IsHardwareFilteringSupported( ttype, format, usage, false );
		}
Beispiel #53
0
 private static extern void ICall_createTexture(IntPtr widget_ptr, TextureResizeMode _resizeMode, TextureUsage _usage, PixelFormat _format);
Beispiel #54
0
		public Texture CreateManual( string name, string group, TextureType type, int width, int height, int depth,
									 int numMipmaps, PixelFormat format, TextureUsage usage, IManualResourceLoader loader )
		{
			return CreateManual( name, group, type, width, height, depth, numMipmaps, format, usage, loader, false, 0,
								 string.Empty );
		}
Beispiel #55
0
		public abstract bool IsHardwareFilteringSupported( TextureType ttype, PixelFormat format, TextureUsage usage,
														   bool preciseFormatOnly );
Beispiel #56
0
		/// <summary>
		/// Create a manual texture with specified width, height and depth (not loaded from a file).
		/// </summary>
		/// <param name="name">The name to give the resulting texture</param>
		/// <param name="group">The name of the resource group to assign the texture to</param>
		/// <param name="type">The type of texture to load/create, defaults to normal 2D textures</param>
		/// <param name="width">The dimensions of the texture</param>
		/// <param name="height">The dimensions of the texture</param>
		/// <param name="depth">The dimensions of the texture</param>
		/// <param name="numMipMaps">
		/// The number of pre-filtered mipmaps to generate. If left to MIP_DEFAULT then
		/// the TextureManager's default number of mipmaps will be used (see setDefaultNumMipmaps()).
		/// If set to MIP_UNLIMITED mipmaps will be generated until the lowest possible
		/// level, 1x1x1.
		/// </param>
		/// <param name="format">
		/// The internal format you wish to request; the manager reserves
		/// the right to create a different format if the one you select is
		/// not available in this context.
		/// </param>
		/// <param name="usage">
		/// The kind of usage this texture is intended for. It
		/// is a combination of TU_STATIC, TU_DYNAMIC, TU_WRITE_ONLY,
		/// TU_AUTOMIPMAP and TU_RENDERTARGET (see TextureUsage enum). You are
		/// strongly advised to use HBU_STATIC_WRITE_ONLY wherever possible, if you need to
		/// update regularly, consider HBU_DYNAMIC_WRITE_ONLY.
		/// </param>
		/// <param name="loader">
		/// If you intend the contents of the manual texture to be
		/// regularly updated, to the extent that you don't need to recover
		/// the contents if the texture content is lost somehow, you can leave
		/// this parameter as null. However, if you intend to populate the
		/// texture only once, then you should implement ManualResourceLoader
		/// and pass a pointer to it in this parameter; this means that if the
		/// manual texture ever needs to be reloaded, the ManualResourceLoader
		/// will be called to do it.
		/// </param>
		/// <param name="hwGammaCorrection"></param>
		/// <param name="fsaa"></param>
		/// <param name="fsaaHint"></param>
		/// <returns></returns>
		public Texture CreateManual( string name, string group, TextureType type, int width, int height, int depth,
									 int numMipMaps, PixelFormat format, TextureUsage usage, IManualResourceLoader loader,
									 bool hwGammaCorrection, int fsaa, string fsaaHint )
		{
			var ret = (Texture)Create( name, group, true, loader, null );
			ret.TextureType = type;
			ret.Width = width;
			ret.Height = height;
			ret.Depth = depth;
			ret.MipmapCount = ( numMipMaps == -1 ) ? this._defaultMipmapCount : numMipMaps;
			ret.SetFormat( format );
			ret.Usage = usage;
			ret.HardwareGammaEnabled = hwGammaCorrection;
			ret.SetFSAA( fsaa, fsaaHint );
			ret.CreateInternalResources();
			return ret;
		}
Beispiel #57
0
		public override PixelFormat GetNativeFormat( TextureType ttype, PixelFormat format, TextureUsage usage )
		{
			// Adjust requested parameters to capabilities
			RenderSystemCapabilities caps = Root.Instance.RenderSystem.Capabilities;

			// Check compressed texture support
			// if a compressed format not supported, revert to PF_A8R8G8B8
			if ( PixelUtil.IsCompressed( format ) && !caps.HasCapability( Capabilities.TextureCompressionDXT ) )
			{
				return PixelFormat.A8R8G8B8;
			}
			// if floating point textures not supported, revert to PF_A8R8G8B8
			if ( PixelUtil.IsFloatingPoint( format ) && !caps.HasCapability( Capabilities.TextureFloat ) )
			{
				return PixelFormat.A8R8G8B8;
			}

			// Check if this is a valid rendertarget format
			if ( ( usage & TextureUsage.RenderTarget ) != 0 )
			{
				/// Get closest supported alternative
				/// If mFormat is supported it's returned
				return GLRTTManager.Instance.GetSupportedAlternative( format );
			}

			// Supported
			return format;
		}
Beispiel #58
0
		public override PixelFormat GetNativeFormat( TextureType ttype, PixelFormat format, TextureUsage usage )
		{
			return PixelFormat.X8R8G8B8;
		}
 public SpriteEd( GraphicsDevice graphicsDevice, int width, int height, int numberLevels, TextureUsage usage, SurfaceFormat format )
     : base(graphicsDevice, width, height, numberLevels, usage, format)
 {
     _properties.Sprite = this;
 }
Beispiel #60
0
		/// <summary>
		/// Create a manual texture with a depth of 1 (not loaded from a file).
		/// </summary>
		/// <param name="name">The name to give the resulting texture</param>
		/// <param name="group">The name of the resource group to assign the texture to</param>
		/// <param name="type">The type of texture to load/create, defaults to normal 2D textures</param>
		/// <param name="width">The dimensions of the texture</param>
		/// <param name="height">The dimensions of the texture</param>
		/// <param name="numMipmaps">
		/// The number of pre-filtered mipmaps to generate. If left to MIP_DEFAULT then
		/// the TextureManager's default number of mipmaps will be used (see setDefaultNumMipmaps()).
		/// If set to MIP_UNLIMITED mipmaps will be generated until the lowest possible
		/// level, 1x1x1.
		/// </param>
		/// <param name="format">
		/// The internal format you wish to request; the manager reserves
		/// the right to create a different format if the one you select is
		/// not available in this context.
		/// </param>
		/// <param name="usage">
		/// The kind of usage this texture is intended for. It
		/// is a combination of TU_STATIC, TU_DYNAMIC, TU_WRITE_ONLY,
		/// TU_AUTOMIPMAP and TU_RENDERTARGET (see TextureUsage enum). You are
		/// strongly advised to use HBU_STATIC_WRITE_ONLY wherever possible, if you need to
		/// update regularly, consider HBU_DYNAMIC_WRITE_ONLY.
		/// </param>
		/// <returns></returns>
		public Texture CreateManual( string name, string group, TextureType type, int width, int height, int numMipmaps,
									 PixelFormat format, TextureUsage usage )
		{
			return CreateManual( name, group, type, width, height, 1, numMipmaps, format, usage, null, false, 0, String.Empty );
		}