Exemplo n.º 1
0
		public static Texture3D.Texture3DSubresource[] CreateMipMaps(int mipLevels, int width, int height, int depth)
		{
			var result = new Texture3D.Texture3DSubresource[mipLevels];
			for (int level = 0; level < mipLevels; level++)
			{
				result[level] = new Texture3D.Texture3DSubresource(width, height, depth);

                width = System.Math.Max((int) System.Math.Floor(width / 2.0), 1);
                height = System.Math.Max((int) System.Math.Floor(height / 2.0), 1);
                depth = System.Math.Max((int) System.Math.Floor(depth / 2.0), 1);
			}
			return result;
		}
Exemplo n.º 2
0
        public static Texture3D.Texture3DSubresource[] CreateMipMaps(int mipLevels, int width, int height, int depth)
        {
            var result = new Texture3D.Texture3DSubresource[mipLevels];

            for (int level = 0; level < mipLevels; level++)
            {
                result[level] = new Texture3D.Texture3DSubresource(width, height, depth);

                width  = System.Math.Max((int)System.Math.Floor(width / 2.0), 1);
                height = System.Math.Max((int)System.Math.Floor(height / 2.0), 1);
                depth  = System.Math.Max((int)System.Math.Floor(depth / 2.0), 1);
            }
            return(result);
        }
			public Texture3DView(Texture3D resource, RenderTargetViewDescription.Texture3DResource description)
			{
				_subresource = resource.GetSubresource(description.MipSlice);
				_firstDepthSlice = description.FirstDepthSlice;
				_depthSliceCount = description.DepthSliceCount;
			}