Why does the reflection probe turn into a white image after turning off Mipmap?

1) Why does the reflection probe turn into a white image after turning off Mipmap
? 2) 2021.3 Android failed to load videos from AssetBundle for
playback. 3) Can SBP solve the problem of extra GameObjects in model files such as FBX when packaging
? 4) Addressables loads already packaged Mono script lost after Prefab


This is the 349th UWA technical knowledge sharing push. It selects hot topics in the UWA community and covers UWA Q&A, community posts and other technical knowledge points to help everyone master and learn more comprehensively.

Rendering

Q: After the reflection probe turns off Mipmap, it turns into a white image. Why is this?

A: It is related to the following option:

It is mentioned in the official Unity manual that this option will process the cube map Mipmap in the form of mirror convolution:

However, the Mipmap here is different from the traditional Mipmap. It is divided according to different roughness:

You can also see this in the Shader code:

If you change this setting to none, the effect will be the same whether Mipmap is turned on or not.

Thanks to the truth@UWA Q&A community for providing the answer


Loading

Q: Under Unity 2021.3 version, Android loads videos from AssetBundle for playback:
AndroidVideoMedia::OpenExtractor could not translate archive

1. The version used is Unity 2021.3.8
2. No compression is set when packaging the video
3. The AssetBundle is placed in the StreamingAssets directory
4. Related code

    btn.onClick.AddListener(() =>
        {
            AssetBundle ab = AssetBundle.LoadFromFile(Application.streamingAssetsPath + "/assetbundle/videos"+ "/1109.ab");
            Debug.Log(ab == null);
            videoPlayer.clip = ab.LoadAsset<VideoClip>("1109");
            videoPlayer.Play();
        });
///build
 BuildPipeline.BuildAssetBundles(config.OutPath, BuildAssetBundleOptions.UncompressedAssetBundle, config.buildTarget);

Problem:
Video cannot be loaded and played on mobile phones below Android 9.0. Log:

Unity AndroidVideoMedia::OpenExtractor could not translate archive:/CAB-8621c60d70de42f9c22e8270082bc81a/CAB-8621c60d70de42f9c22e8270082bc81a. resource to local file.  Make sure file exists, is on disk (not in memory) and not compressed.

There is no problem with Android 9.0 and above.

Some reference:
Learn from the forum post that if you want to load video playback from AssetBundle, you must set it to not compress:
Video: Support for reading videos from AssetBundles on Android. - Unity Forum

The official documentation also states:
Unity supports playback from uncompressed asset bundles. For Android Pie and above, Unity supports playback from compressed asset bundles.

According to the above, the video should be loaded and played, but there is still a problem. I wonder if any Taoist friends have encountered it.

In addition, I would like to ask what your plan is when dealing with video resources. Do you also put them into AssetBundle, or directly put them in the resource directory unchanged?

A1: After a self-test, it can be solved without packaging the video in AssetBundle.

Or refer to this solution:
Video - Load VideoClip in assetbundle on Android | Page 2 - Unity Forum

code for reference:

private IEnumerator loadVideo(string pathvideo)
    {
        assetBundleRequest = DownloadingScreenManager.getInstance().getMapAssetBundle()["vide_bundlename"].LoadAssetAsync(pathvideo);

        yield return assetBundleRequest;

        textAsset = (TextAsset)assetBundleRequest.asset;

        File.WriteAllBytes(Path.Combine(Application.persistentDataPath, pathvideo + ".mp4"), textAsset.bytes);

        string url = Application.persistentDataPath + "/" + pathvideo + ".mp4";

        videoPlayer.url = url;
    }

Thanks to the question owner zerolj@UWA Q&A Community for providing the answer

A2: There are many problems in playing videos from the Bundle package. Different models perform differently. Some can play videos while others cannot. Our approach is to package the binary into a Bundle, copy it to the user directory when starting the game, specify the path when playing, and finally handle the playback timeout.

Thanks to Li Wei @UWA Q&A Community for providing the answer


Memory

Q: Can the Scriptable Build Pipeline solve the problem of extra GameObjects in model files such as FBX when packaging?

The normal Asset compilation process programming model will bring in a lot of unnecessary things. The most prominent one is the copied Build In resources, followed by the large amount of Remapper memory consumption.

Currently, we don’t understand the capabilities of SBP, so we are still using the process of copying Mesh and AnimationClip for optimization.

I wonder if SBP has the ability to remove some file references under a single AssetPath? The other thing is whether you can forcefully disconnect resource references (similar to Editor icons, Shader's default textures, etc.).

A: I tested it myself and confirmed that it can be done. It can be proposed just by setting it in the IBuildTask layer.

Thanks to the question owner Ou Yuesong@UWA Q&A Community for providing the answer


Addressable

Q: For all Prefabs packaged with Addressables, the Mono scripts are lost after loading. After using several versions of Addressables and setting all MonoScript Bundle Naming options, the situation remains unchanged.

I don’t know where the correct setting is?

A: If the script is lost, it means that the resources and code are not related during deserialization. It is best to repackage the resources in case the environment is different.

Thanks to Li Wei @UWA Q&A Community for providing the answer


That’s it for today’s sharing. Life has limits but knowledge has no limits. In the long development cycle, the problems we encountered are just the tip of the iceberg. The UWA community is willing to accompany you to explore and share together. More developers are welcome to join the UWA community.

UWA official website: www.uwa4d.com
UWA community: community.uwa4d.com

 

Guess you like

Origin blog.csdn.net/UWA4D/article/details/132560873