优化之ui字体图集大小

Posted shaojunping

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了优化之ui字体图集大小相关的知识,希望对你有一定的参考价值。

ui图集大小

FSlateRHIResourceManager::FSlateRHIResourceManager()
    : bExpiredResourcesNeedCleanup(false)
    , BadResourceTexture(nullptr)
    , DeleteResourcesCommand(
        TEXT("Slate.DeleteResources"),
        *LOCTEXT("CommandText_DeleteResources", "Flushes and deletes all resources created by Slate‘s RHI Resource Manager.").ToString(),
        FConsoleCommandDelegate::CreateRaw(this, &FSlateRHIResourceManager::DeleteBrushResourcesCommand))

    FCoreDelegates::OnPreExit.AddRaw(this, &FSlateRHIResourceManager::OnAppExit);
    FCoreUObjectDelegates::GetPostGarbageCollect().AddRaw(this, &FSlateRHIResourceManager::OnPostGarbageCollect);

    MaxAltasedTextureSize = FIntPoint(256, 256);
    if (GIsEditor)
    
        AtlasSize = 2048;
    
    else
    
        AtlasSize = 1024;
        if (GConfig)
        
            int32 RequestedSize = 1024;
            GConfig->GetInt(TEXT("SlateRenderer"), TEXT("TextureAtlasSize"), RequestedSize, GEngineIni);
            AtlasSize = FMath::Clamp<uint32>(RequestedSize, 0, 2048);

            int32 MaxAtlasedTextureWidth = 256;
            int32 MaxAtlasedTextureHeight = 256;
            GConfig->GetInt(TEXT("SlateRenderer"), TEXT("MaxAtlasedTextureWidth"), MaxAtlasedTextureWidth, GEngineIni);
            GConfig->GetInt(TEXT("SlateRenderer"), TEXT("MaxAtlasedTextureHeight"), MaxAtlasedTextureHeight, GEngineIni);

 

以上是关于优化之ui字体图集大小的主要内容,如果未能解决你的问题,请参考以下文章

PIXIJS性能优化之图集加载

cocos creator 性能优化之减少drawcall数量

UI优化总结

什么叫新建图集

UI图集分类

UGUIDrawCall优化