zoukankan      html  css  js  c++  java
  • UE5 AndroidVulkan Preview失效排查

    问题描述:
    UE5 PC上想切Android Vulkan,发现切不过去,点了没反应,还是SM5。
    UEditorPerProjectUserSettings的配置里已经加了
    PreviewFeatureLevel=1
    PreviewShaderFormatName=SF_VULKAN_ES31_ANDROID
    bPreviewFeatureLevelActive=True
    bAllowSelectTranslucent=False
    PreviewPlatformName=Android

    跟Code排查。
    UE在决定SceneRender的时候,创建DeferredScene还是MobileScene是通过FeatureLevel决定的,而这个信息记录在
    SavedConfigWindowsEditorEditorPerProjectUserSettings.ini PreviewFeatureLevel
    注意UE4 不区分Windows和WindowsEditor,UE5区分,第一个坑。
    LoadMap的时候,用若干个参数序列化一个CommandLine,里面会有FeatureLevel,决定加载场景的时候用
    FString LoadCommand = FString::Printf(TEXT("MAP LOAD FILE="%s" TEMPLATE=%d SHOWPROGRESS=%d FEATURELEVEL=%d"), *Filename, LoadAsTemplate, bShowProgress, (int32)GEditor->DefaultWorldFeatureLevel);
    const bool bResult = GEditor->Exec( NULL, *LoadCommand );
    第二个坑,UE5的 UEditorPerProjectUserSettings 类里多了 bPreviewFeatureLevelWasDefault 这个配置。默认是true,并且在初始化UEditorPerProjectUserSettings配置的时候,回去检查,如果是True的话,FeatureLevel强制用最高的。这也导致了PC上ES3_1不生效,切不过去。
        if (bPreviewFeatureLevelWasDefault || PreviewFeatureLevel > GMaxRHIFeatureLevel)
        {
            PreviewFeatureLevel = GMaxRHIFeatureLevel;
            PreviewShaderFormatName = NAME_None;
            bPreviewFeatureLevelActive = false;
            bPreviewFeatureLevelWasDefault = true;
            PreviewDeviceProfileName = NAME_None;
        }
    第三个坑,在SetPreviewPlatform 函数的时候,UE默认如果开了光追强制使用SM5,这个地方要自己改一下
        if (IsRayTracingEnabled())
        {
            if (PreviewPlatform.PreviewFeatureLevel < ERHIFeatureLevel::SM5)
            {
                UE_LOG(LogEditor, Warning, TEXT("Preview feature level is incompatible with ray tracing, defaulting to Shader Model 5"));
                PreviewPlatform.PreviewFeatureLevel = ERHIFeatureLevel::SM5;
            }
            return;
        }
    改完之后,就能看到小机器人了
     
  • 相关阅读:
    卡特兰数
    hdu 1023 Train Problem II
    hdu 1022 Train Problem
    hdu 1021 Fibonacci Again 找规律
    java大数模板
    gcd
    object dection资源
    Rich feature hierarchies for accurate object detection and semantic segmentation(RCNN)
    softmax sigmoid
    凸优化
  • 原文地址:https://www.cnblogs.com/SeekHit/p/15268336.html
Copyright © 2011-2022 走看看