/// <summary> /// Creates a new empty texture atlas. /// </summary> public Texture2DAtlasDynamic(int width, int height, int capacity, GraphicsFormat format) { m_Width = width; m_Height = height; m_Format = format; m_AtlasTexture = RTHandles.Alloc( m_Width, m_Height, 1, DepthBits.None, m_Format, FilterMode.Point, TextureWrapMode.Clamp, TextureDimension.Tex2D, false, true, false, false, 1, 0, MSAASamples.None, false, false ); isAtlasTextureOwner = true; m_AtlasAllocator = new AtlasAllocatorDynamic(width, height, capacity); m_AllocationCache = new Dictionary <int, Vector4>(capacity); }
/// <summary> /// Creates a new empty texture atlas. Use external atlas texture. /// </summary> public Texture2DAtlasDynamic(int width, int height, int capacity, RTHandle atlasTexture) { m_Width = width; m_Height = height; m_Format = atlasTexture.rt.graphicsFormat; m_AtlasTexture = atlasTexture; isAtlasTextureOwner = false; m_AtlasAllocator = new AtlasAllocatorDynamic(width, height, capacity); m_AllocationCache = new Dictionary <int, Vector4>(capacity); }