//  Get access to material textures with lazy loading mechanizm
        internal MyVoxelMaterialTextures GetTextures()
        {
            if (m_textures == null)
            {
                m_textures = new MyVoxelMaterialTextures();

                //  Diffuse XZ
                m_textures.TextureDiffuseForAxisXZ = MyTextureManager.GetTexture<MyTexture2D>(m_diffuseXZ, "", null, LoadingMode.Lazy);

                if (MyRenderConstants.RenderQualityProfile.UseNormals)
                {
                    //  Normal map XZ
                    m_textures.TextureNormalMapForAxisXZ = MyTextureManager.GetTexture<MyTexture2D>(m_normalXZ, "", null, LoadingMode.Lazy);
                }

                //  Diffuse Y
                if (!string.IsNullOrEmpty(m_diffuseY))
                {
                    m_textures.TextureDiffuseForAxisY = MyTextureManager.GetTexture<MyTexture2D>(m_diffuseY, "", null, LoadingMode.Lazy);

                    if (MyRenderConstants.RenderQualityProfile.UseNormals)
                    {
                        //  Normal map Y
                        m_textures.TextureNormalMapForAxisY = MyTextureManager.GetTexture<MyTexture2D>(m_normalY, "", null, LoadingMode.Lazy);
                    }

                }
                else
                {
                    m_textures.TextureDiffuseForAxisY = m_textures.TextureDiffuseForAxisXZ;

                    if (MyRenderConstants.RenderQualityProfile.UseNormals)
                    {
                        m_textures.TextureNormalMapForAxisY = m_textures.TextureNormalMapForAxisXZ;
                    }
                }
            }

            m_textures.TextureDiffuseForAxisXZ.CheckTextureClass(MyTextureClassEnum.DiffuseEmissive);
            m_textures.TextureDiffuseForAxisY.CheckTextureClass(MyTextureClassEnum.DiffuseEmissive);
            m_textures.TextureNormalMapForAxisXZ.CheckTextureClass(MyTextureClassEnum.NormalSpecular);
            m_textures.TextureNormalMapForAxisY.CheckTextureClass(MyTextureClassEnum.NormalSpecular);

            UseFlag = true;
            return m_textures;
        }
        //  Get access to material textures with lazy loading mechanizm
        internal MyVoxelMaterialTextures GetTextures()
        {
            if (m_textures == null)
            {
                m_textures = new MyVoxelMaterialTextures();

                //  Diffuse XZ
                m_textures.TextureDiffuseForAxisXZ = MyTextureManager.GetTexture <MyTexture2D>(m_diffuseXZ, "", null, LoadingMode.Lazy);

                if (MyRenderConstants.RenderQualityProfile.UseNormals)
                {
                    //  Normal map XZ
                    m_textures.TextureNormalMapForAxisXZ = MyTextureManager.GetTexture <MyTexture2D>(m_normalXZ, "", null, LoadingMode.Lazy);
                }

                //  Diffuse Y
                if (!string.IsNullOrEmpty(m_diffuseY))
                {
                    m_textures.TextureDiffuseForAxisY = MyTextureManager.GetTexture <MyTexture2D>(m_diffuseY, "", null, LoadingMode.Lazy);

                    if (MyRenderConstants.RenderQualityProfile.UseNormals)
                    {
                        //  Normal map Y
                        m_textures.TextureNormalMapForAxisY = MyTextureManager.GetTexture <MyTexture2D>(m_normalY, "", null, LoadingMode.Lazy);
                    }
                }
                else
                {
                    m_textures.TextureDiffuseForAxisY = m_textures.TextureDiffuseForAxisXZ;

                    if (MyRenderConstants.RenderQualityProfile.UseNormals)
                    {
                        m_textures.TextureNormalMapForAxisY = m_textures.TextureNormalMapForAxisXZ;
                    }
                }
            }

            m_textures.TextureDiffuseForAxisXZ.CheckTextureClass(MyTextureClassEnum.DiffuseEmissive);
            m_textures.TextureDiffuseForAxisY.CheckTextureClass(MyTextureClassEnum.DiffuseEmissive);
            m_textures.TextureNormalMapForAxisXZ.CheckTextureClass(MyTextureClassEnum.NormalSpecular);
            m_textures.TextureNormalMapForAxisY.CheckTextureClass(MyTextureClassEnum.NormalSpecular);

            UseFlag = true;
            return(m_textures);
        }
 internal void UnloadContent()
 {
     m_textures = null;
 }
 internal void UnloadContent()
 {
     m_textures = null;
 }