CesiumGS / cesium-unreal

Bringing the 3D geospatial ecosystem to Unreal Engine
https://cesium.com/platform/cesium-for-unreal/
Apache License 2.0
924 stars 296 forks source link

Add Android support (especially for XR applications) #190

Closed CesiumBen closed 3 years ago

CesiumBen commented 3 years ago

We’re having a build issue with cesium for unreal. The build fails with these issues:

Unreal Android Build Error

Each issue mentioned that is not found (and could we potentially mean TOptional). I think that this might be a c++ version error when exporting to a separate platform than windows, (we’re exporting for Android ASTC). We read that before c++ 17 was experimental so you would reference it as <experimental/optional>, so high chances that the issue might be the version of C++ we’re targeting. We’re having a hard time finding any solutions but might be a no-brainer.

If anyone could shed some light on this that would be awesome. @kring @baothientran @nithinp7 @dzungpng @getinthedamnbox

shehzan10 commented 3 years ago

@CesiumBen Can you try using the install branch of cesium-unreal. Be sure to update submodules recursively using git submodule update --init --recursive.

baothientran commented 3 years ago

@CesiumBen maybe add C++17 in the project too. @kring mentions it here https://github.com/CesiumGS/cesium-unreal-demo/pull/13#discussion_r586032007. I haven't tried it though

CesiumBen commented 3 years ago

Have tried a few things with no success. Attempting builds in between each change with no difference.

  1. Setting build version in the AndroidToolChain.cs \Engine\Source\Programs\UnrealBuildTool\Platform\Android\AndroidToolChain.cs (solution on a link provided by Matt).

Attempt1-1

  1. Then I tried what you said Bao, @kring mentioned here

Attempt1-2

  1. Finally I checked out the cesium-unreal repo branch to install and added in android in the whitelist

Attempt1-3

My hunch is it could be the NDK as well. going to keep digging

getinthedamnbox commented 3 years ago

I cloned the latest version of cesium-unreal-demo this morning, and we're now able to get past the build and deploy steps now, all the way to "Launch Complete" (with new problems at that point). Thanks, everyone.

I'm seeing some new errors now, screenshotted below. Does anyone have a guess as to what might be going on here?

It's strange that it's referencing a D:/ drive when my PC doesn't have one, but I figure that's probably the Quest.

Unreal_log_2021 03 05_01

Unreal_log_2021 03 05_02

EDIT: This might've actually been a step backward (e.g., it couldn't build the plugin, so it just bypassed it). I'll keep looking.

getinthedamnbox commented 3 years ago

@shehzan10 pointed out that the problem is that cesium-native is built for Windows instead of Android. I'm working on trying to build it for Android.

I'm feeling my way in the dark with this. Thought I'd post my progress in case anyone can spot what I'm doing wrong.

Relevant docs:

  1. https://developer.android.com/studio/projects/install-ndk
  2. https://developer.android.com/studio/projects/add-native-code
  3. https://developer.android.com/studio/projects/configure-cmake

Build was failing with this message:

...\cesium-native\cesium-native\CesiumGltf\src\Model.cpp:191:108: error: implicit conversion loses integer precision: 'int64_t' (aka 'long long') to 'std::__ndk1::__wrap_iter<int *>::difference_type' (aka 'int') [-Werror,-Wshorten-64-to-32]

This is the line:

std::copy(pRhsDefaultScene->nodes.begin(), pRhsDefaultScene->nodes.end(), newScene.nodes.begin() + int64_t(originalNodeCount));

There are a number of similar errors with casting, and I don't fully understand them. For example, in QuantizedMeshContent.cpp, there are four lines like this one:

std::partial_sort_copy(westEdgeIndices.begin(), 
            westEdgeIndices.end(), 
            sortEdgeIndices.begin(), 
            sortEdgeIndices.begin() + westVertexCount,
            [&uvsAndHeights](auto lhs, auto rhs) { return uvsAndHeights[lhs].y < uvsAndHeights[rhs].y;  });

westVertexCount is a uint32_t. When it's used in the operation above, it's implicitly being cast to an int, and the compiler complains that the conversion changes its signedness.

If all I care about is getting this to compile, I can make those implicit casts explicit. Here are the spots where I did that:

Model.cpp
[191] std::copy(pRhsDefaultScene->nodes.begin(), pRhsDefaultScene->nodes.end(), newScene.nodes.begin() + (int)int64_t(originalNodeCount));

SqliteCache.cpp
[215] std::time_t expiryTime = (std::time_t)sqlite3_column_int64(this->_getEntryStmtWrapper.get(), 1);

decodeDraco.cpp
[51] gsl::span<const std::byte> data(buffer.cesium.data.data() + bufferView.byteOffset, (unsigned int)static_cast<uint64_t>(bufferView.byteLength));

Reader.cpp
[270] buffer.cesium.data = std::vector<std::byte>(binaryChunk.begin(), binaryChunk.begin() + (int)buffer.byteLength);

QuantizedMeshContent.cpp
[437-441] std::partial_sort_copy(westEdgeIndices.begin(), 
            westEdgeIndices.end(), 
            sortEdgeIndices.begin(), 
            sortEdgeIndices.begin() + (int)westVertexCount, 
            [&uvsAndHeights](auto lhs, auto rhs) { return uvsAndHeights[lhs].y < uvsAndHeights[rhs].y;  });
[462-466] std::partial_sort_copy(southEdgeIndices.begin(), 
            southEdgeIndices.end(), 
            sortEdgeIndices.begin(), 
            sortEdgeIndices.begin() + (int)southVertexCount,
            [&uvsAndHeights](auto lhs, auto rhs) { return uvsAndHeights[lhs].x > uvsAndHeights[rhs].x;  });
[487-491] std::partial_sort_copy(eastEdgeIndices.begin(), 
            eastEdgeIndices.end(), 
            sortEdgeIndices.begin(), 
            sortEdgeIndices.begin() + (int)eastVertexCount,
            [&uvsAndHeights](auto lhs, auto rhs) { return uvsAndHeights[lhs].y > uvsAndHeights[rhs].y;  });
[512-516] std::partial_sort_copy(northEdgeIndices.begin(), 
            northEdgeIndices.end(), 
            sortEdgeIndices.begin(), 
            sortEdgeIndices.begin() + (int)northVertexCount,
            [&uvsAndHeights](auto lhs, auto rhs) { return uvsAndHeights[lhs].x < uvsAndHeights[rhs].x; });

TestTilesetSelectionAlgorithm.cpp
[26] std::streamsize size = (int)file.tellg();

After that, I hit this problem:

C:/Users/mboydsurka/AppData/Local/Android/Sdk/ndk/21.1.6352462/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/c++/v1/filesystem:1084: error: undefined reference to 'std::__ndk1::__fs::filesystem::path::__root_directory() const'

That line 1084 is the return statement in this:

  _LIBCPP_INLINE_VISIBILITY bool has_root_directory() const {
    return !__root_directory().empty();
  }

Some problem with the toolchain.

javagl commented 3 years ago

I think the "right" way of fixing the first warning would be

std::copy(pRhsDefaultScene->nodes.begin(), pRhsDefaultScene->nodes.end(), newScene.nodes.begin() + std::vector<int32_t>::difference_type(originalNodeCount));

but some C++ expert should confirm that.

getinthedamnbox commented 3 years ago

Thank you, @javagl! That works and makes more sense.

shehzan10 commented 3 years ago

Reference: Slide 44 onwards in https://www.slideshare.net/GerkeMaxPreussner/plugins-thirdparty-sdks-in-ue4

n-baja commented 3 years ago

I am able to build the Cesium for Unreal Samples project for the Oculus Quest 2. I can build a .apk, or I can use Launch. Both compile without any errors, but it just shows up black for me inside the Quest. I thought maybe there was a lighting issue or a problem with the Cesium Sun/Sky, but I deleted the sky and put in directional lights, and then I put a glowing material on the earth's surface, and everything was still showing up black. I've only tried on the Quest 2, since that's my desired target.

@getinthedamnbox I was able to get around the error you posted above. By default Unreal doesn't actually package everything in your project as you might expect.

There are two things I would try to fix this:

  1. Click the little down arrow next to the Launch button and check "Enable cooking on the fly". This will try to package all of the references into one package when you hit launch. image

  2. You can manually add folders for it to add to the build. First go to the content browser and click view options on the bottom right, and check Show Engine Content and Show Plugin Content. image Then in your project settings, search for "additional" and there's an option called Additional Asset Directories to Cook. Click the plus sign twice, and add your CesiumSamples folder (under Content) and add the CesiumForUnreal folder. image image

Hopefully one or both of these works for you.

Another thing I would mention is that by default when Unreal builds an .apk, it tries to keep the file size down, and it accomplishes this by creating a separate .obb file that contains other data. You can package the .obb information into the .apk (if that's what you want to do) by searching for "package game" in your project settings and checking package game data inside .apk. image

Link to the Cesium community forum post that brought me here

xuelongmu commented 3 years ago

Hi @n-baja,

Thank you for the detailed documentation on packaging the APK for Android. This is very helpful for us.

I assume that you were able to compile cesium-native with Android NDK then? Did you run into any issues compiling that? Any insights would help, thanks again.

n-baja commented 3 years ago

Unfortunately this is outside my wheelhouse. It's possible that someone else on my team will be able to try this next month, assuming this hasn't been pushed further along by others by then.

shehzan10 commented 3 years ago

I did some initial testing with Android support over the weekend - https://github.com/CesiumGS/cesium-unreal/tree/android-platform.

Here are my notes:

I don't think I'll be able to test this more for a while. But if there are any volunteers who want to look into this, go ahead.

shehzan10 commented 3 years ago

Latest Update on Android

Branch: https://github.com/CesiumGS/cesium-unreal/tree/android-platform

What works

What doesn't work

Full log:

UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): ********** BUILD COMMAND STARTED **********
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Running: C:\Program Files\Epic Games\UE_4.26\Engine\Binaries\DotNET\UnrealBuildTool.exe CesiumForUnrealSamples Android Shipping -Project=C:\Users\smohammed\workspace\cesium-unreal-samples\CesiumForUnrealSamples.uproject  C:\Users\smohammed\workspace\cesium-unreal-samples\CesiumForUnrealSamples.uproject -N
oUBTMakefiles  -remoteini="C:\Users\smohammed\workspace\cesium-unreal-samples" -skipdeploy -Manifest=C:\Users\smohammed\workspace\cesium-unreal-samples\Intermediate\Build\Manifest.xml -NoHotReload -log="C:\Users\smohammed\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+Program+Files+Epic+Games+UE_4.26\UBT-CesiumForUnrealSamples-Android-Shipping.txt"
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):   Using 'git status' to determine working set for adaptive non-unity build (C:\Users\smohammed\workspace\cesium-unreal-samples).
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):   PLATFORM_ANDROID_NDK_VERSION = 210500
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):   NDK toolchain: r21e, NDK version: 21, GccVersion: 4.9, ClangVersion: 9.0.9
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):   Parsing headers for CesiumForUnrealSamples
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     Running UnrealHeaderTool "C:\Users\smohammed\workspace\cesium-unreal-samples\CesiumForUnrealSamples.uproject" "C:\Users\smohammed\workspace\cesium-unreal-samples\Intermediate\Build\Android\CesiumForUnrealSamples\Shipping\CesiumForUnrealSamples.uhtmanifest" -LogCmds="loginit warning, logexit warning, l
ogdatabase error" -Unattended -WarningsAsErrors -abslog="C:\Users\smohammed\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+Program+Files+Epic+Games+UE_4.26\UHT-CesiumForUnrealSamples-Android-Shipping.txt" -installed
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):   Reflection code generated for CesiumForUnrealSamples in 3.055182 seconds
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):   Compiling Native 64-bit code with NDK API 'android-21'
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):   Writing manifest to C:\Users\smohammed\workspace\cesium-unreal-samples\Intermediate\Build\Manifest.xml
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):   Building CesiumForUnrealSamples...
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):   [Upgrade]
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):   [Upgrade] Using backward-compatible build settings. The latest version of UE4 sets the following values by default, which may require code changes:
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):   [Upgrade]     bLegacyPublicIncludePaths = false                 => Omits subfolders from public include paths to reduce compiler command line length. (Previously: true).
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):   [Upgrade]     ShadowVariableWarningLevel = WarningLevel.Error   => Treats shadowed variable warnings as errors. (Previously: WarningLevel.Warning).
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):   [Upgrade]     PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs   => Set in build.cs files to enables IWYU-style PCH model. See https://docs.unrealengine.com/en-US/Programming/BuildTools/UnrealBuildTool/IWYU/index.html. (Previously: PCHUsageMode.UseSharedPCHs).
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):   [Upgrade] Suppress this message by setting 'DefaultBuildSettings = BuildSettingsVersion.V2;' in CesiumForUnrealSamples.Target.cs, and explicitly overriding settings that differ from the new defaults.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):   [Upgrade]
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):   Building 4 actions with 32 processes...
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     [1/4] SharedPCH.Core.h [arm64]
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     [2/4] CesiumForUnrealSamples.cpp [arm64]
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     [3/4] CesiumForUnrealSamples-Android-Shipping-arm64.so
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     ld.lld: error: undefined symbol: genTangSpaceDefault
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>> referenced by CesiumGltfComponent.cpp:237 (C:/Users/smohammed/workspace/PackagesAndroid/CesiumForUnreal/HostProject/Plugins/CesiumForUnreal/Source/CesiumRuntime/Private\CesiumGltfComponent.cpp:237)
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>>               C:/Program Files/Epic Games/UE_4.26/Engine/Plugins/Marketplace/CesiumForUnreal/Intermediate/Build/Android/UE4/Shipping/CesiumRuntime/Module.CesiumRuntime.cppa8.o:(void loadPrimitive<std::__ndk1::vector<unsigned int, std::__ndk1::allocator<unsigned int> > >(std::__ndk1::vector<LoadMod
elResult, std::__ndk1::allocator<LoadModelResult> >&, CesiumGltf::Model const&, CesiumGltf::Mesh const&, CesiumGltf::MeshPrimitive const&, glm::mat<4, 4, double, (glm::qualifier)0> const&, IPhysXCooking*, CesiumGltf::Accessor const&, CesiumGltf::AccessorView<FVector> const&, std::__ndk1::vector<unsigned int, std::__ndk1::allocator<unsigned int> > const&))
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>> referenced by CesiumGltfComponent.cpp:237 (C:/Users/smohammed/workspace/PackagesAndroid/CesiumForUnreal/HostProject/Plugins/CesiumForUnreal/Source/CesiumRuntime/Private\CesiumGltfComponent.cpp:237)
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>>               C:/Program Files/Epic Games/UE_4.26/Engine/Plugins/Marketplace/CesiumForUnreal/Intermediate/Build/Android/UE4/Shipping/CesiumRuntime/Module.CesiumRuntime.cppa8.o:(void loadPrimitive<std::__ndk1::vector<unsigned int, std::__ndk1::allocator<unsigned int> > >(std::__ndk1::vector<LoadMod
elResult, std::__ndk1::allocator<LoadModelResult> >&, CesiumGltf::Model const&, CesiumGltf::Mesh const&, CesiumGltf::MeshPrimitive const&, glm::mat<4, 4, double, (glm::qualifier)0> const&, IPhysXCooking*, CesiumGltf::Accessor const&, CesiumGltf::AccessorView<FVector> const&, std::__ndk1::vector<unsigned int, std::__ndk1::allocator<unsigned int> > const&))
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>> referenced by CesiumGltfComponent.cpp:237 (C:/Users/smohammed/workspace/PackagesAndroid/CesiumForUnreal/HostProject/Plugins/CesiumForUnreal/Source/CesiumRuntime/Private\CesiumGltfComponent.cpp:237)
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>>               C:/Program Files/Epic Games/UE_4.26/Engine/Plugins/Marketplace/CesiumForUnreal/Intermediate/Build/Android/UE4/Shipping/CesiumRuntime/Module.CesiumRuntime.cppa8.o:(void loadPrimitive<CesiumGltf::AccessorView<unsigned short> >(std::__ndk1::vector<LoadModelResult, std::__ndk1::allocator
<LoadModelResult> >&, CesiumGltf::Model const&, CesiumGltf::Mesh const&, CesiumGltf::MeshPrimitive const&, glm::mat<4, 4, double, (glm::qualifier)0> const&, IPhysXCooking*, CesiumGltf::Accessor const&, CesiumGltf::AccessorView<FVector> const&, CesiumGltf::AccessorView<unsigned short> const&))
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>> referenced by CesiumGltfComponent.cpp:237 (C:/Users/smohammed/workspace/PackagesAndroid/CesiumForUnreal/HostProject/Plugins/CesiumForUnreal/Source/CesiumRuntime/Private\CesiumGltfComponent.cpp:237)
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>>               C:/Program Files/Epic Games/UE_4.26/Engine/Plugins/Marketplace/CesiumForUnreal/Intermediate/Build/Android/UE4/Shipping/CesiumRuntime/Module.CesiumRuntime.cppa8.o:(void loadPrimitive<CesiumGltf::AccessorView<unsigned short> >(std::__ndk1::vector<LoadModelResult, std::__ndk1::allocator
<LoadModelResult> >&, CesiumGltf::Model const&, CesiumGltf::Mesh const&, CesiumGltf::MeshPrimitive const&, glm::mat<4, 4, double, (glm::qualifier)0> const&, IPhysXCooking*, CesiumGltf::Accessor const&, CesiumGltf::AccessorView<FVector> const&, CesiumGltf::AccessorView<unsigned short> const&))
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>> referenced by CesiumGltfComponent.cpp:237 (C:/Users/smohammed/workspace/PackagesAndroid/CesiumForUnreal/HostProject/Plugins/CesiumForUnreal/Source/CesiumRuntime/Private\CesiumGltfComponent.cpp:237)
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>>               C:/Program Files/Epic Games/UE_4.26/Engine/Plugins/Marketplace/CesiumForUnreal/Intermediate/Build/Android/UE4/Shipping/CesiumRuntime/Module.CesiumRuntime.cppa8.o:(void loadPrimitive<CesiumGltf::AccessorView<unsigned int> >(std::__ndk1::vector<LoadModelResult, std::__ndk1::allocator<L
oadModelResult> >&, CesiumGltf::Model const&, CesiumGltf::Mesh const&, CesiumGltf::MeshPrimitive const&, glm::mat<4, 4, double, (glm::qualifier)0> const&, IPhysXCooking*, CesiumGltf::Accessor const&, CesiumGltf::AccessorView<FVector> const&, CesiumGltf::AccessorView<unsigned int> const&))
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>> referenced by CesiumGltfComponent.cpp:237 (C:/Users/smohammed/workspace/PackagesAndroid/CesiumForUnreal/HostProject/Plugins/CesiumForUnreal/Source/CesiumRuntime/Private\CesiumGltfComponent.cpp:237)
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>>               C:/Program Files/Epic Games/UE_4.26/Engine/Plugins/Marketplace/CesiumForUnreal/Intermediate/Build/Android/UE4/Shipping/CesiumRuntime/Module.CesiumRuntime.cppa8.o:(void loadPrimitive<CesiumGltf::AccessorView<unsigned int> >(std::__ndk1::vector<LoadModelResult, std::__ndk1::allocator<L
oadModelResult> >&, CesiumGltf::Model const&, CesiumGltf::Mesh const&, CesiumGltf::MeshPrimitive const&, glm::mat<4, 4, double, (glm::qualifier)0> const&, IPhysXCooking*, CesiumGltf::Accessor const&, CesiumGltf::AccessorView<FVector> const&, CesiumGltf::AccessorView<unsigned int> const&))
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):   
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     ld.lld: error: undefined symbol: stderr
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>> referenced by kd_tree_attributes_decoder.cc
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>>               kd_tree_attributes_decoder.cc.o:(bool draco::FloatPointsTreeDecoder::DecodePointCloud<draco::PointAttributeVectorOutputIterator<float> >(draco::DecoderBuffer*, draco::PointAttributeVectorOutputIterator<float>&)) in archive C:/Program Files/Epic Games/UE_4.26/Engine/Plugins/Marketplac
e/CesiumForUnreal/Source/ThirdParty/lib/Android-xaarch64\libdraco.a
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>> referenced by kd_tree_attributes_decoder.cc
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>>               kd_tree_attributes_decoder.cc.o:(bool draco::FloatPointsTreeDecoder::DecodePointCloud<draco::PointAttributeVectorOutputIterator<float> >(draco::DecoderBuffer*, draco::PointAttributeVectorOutputIterator<float>&)) in archive C:/Program Files/Epic Games/UE_4.26/Engine/Plugins/Marketplac
e/CesiumForUnreal/Source/ThirdParty/lib/Android-xaarch64\libdraco.a
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>> referenced by kd_tree_attributes_decoder.cc
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>>               kd_tree_attributes_decoder.cc.o:(bool draco::FloatPointsTreeDecoder::DecodePointCloud<draco::PointAttributeVectorOutputIterator<float> >(draco::DecoderBuffer*, draco::PointAttributeVectorOutputIterator<float>&)) in archive C:/Program Files/Epic Games/UE_4.26/Engine/Plugins/Marketplac
e/CesiumForUnreal/Source/ThirdParty/lib/Android-xaarch64\libdraco.a
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>> referenced by kd_tree_attributes_decoder.cc
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>>               kd_tree_attributes_decoder.cc.o:(bool draco::FloatPointsTreeDecoder::DecodePointCloud<draco::PointAttributeVectorOutputIterator<float> >(draco::DecoderBuffer*, draco::PointAttributeVectorOutputIterator<float>&)) in archive C:/Program Files/Epic Games/UE_4.26/Engine/Plugins/Marketplac
e/CesiumForUnreal/Source/ThirdParty/lib/Android-xaarch64\libdraco.a
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>> referenced by spdlog.cpp
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>>               spdlog.cpp.o:(spdlog::logger::err_handler_(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&)) in archive C:/Program Files/Epic Games/UE_4.26/Engine/Plugins/Marketplace/CesiumForUnreal/Source/ThirdParty/lib/Android-xaarch64\libspdlo
g.a
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>> referenced by spdlog.cpp
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>>               spdlog.cpp.o:(spdlog::logger::err_handler_(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&)) in archive C:/Program Files/Epic Games/UE_4.26/Engine/Plugins/Marketplace/CesiumForUnreal/Source/ThirdParty/lib/Android-xaarch64\libspdlo
g.a
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>> referenced by color_sinks.cpp
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>>               color_sinks.cpp.o:(spdlog::sinks::ansicolor_stderr_sink<spdlog::details::console_mutex>::ansicolor_stderr_sink(spdlog::color_mode)) in archive C:/Program Files/Epic Games/UE_4.26/Engine/Plugins/Marketplace/CesiumForUnreal/Source/ThirdParty/lib/Android-xaarch64\libspdlog.a
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>> referenced by color_sinks.cpp
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>>               color_sinks.cpp.o:(spdlog::sinks::ansicolor_stderr_sink<spdlog::details::console_mutex>::ansicolor_stderr_sink(spdlog::color_mode)) in archive C:/Program Files/Epic Games/UE_4.26/Engine/Plugins/Marketplace/CesiumForUnreal/Source/ThirdParty/lib/Android-xaarch64\libspdlog.a
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>> referenced by color_sinks.cpp
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>>               color_sinks.cpp.o:(spdlog::sinks::ansicolor_stderr_sink<spdlog::details::console_nullmutex>::ansicolor_stderr_sink(spdlog::color_mode)) in archive C:/Program Files/Epic Games/UE_4.26/Engine/Plugins/Marketplace/CesiumForUnreal/Source/ThirdParty/lib/Android-xaarch64\libspdlog.a
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>> referenced by color_sinks.cpp
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>>               color_sinks.cpp.o:(spdlog::sinks::ansicolor_stderr_sink<spdlog::details::console_nullmutex>::ansicolor_stderr_sink(spdlog::color_mode)) in archive C:/Program Files/Epic Games/UE_4.26/Engine/Plugins/Marketplace/CesiumForUnreal/Source/ThirdParty/lib/Android-xaarch64\libspdlog.a
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>> referenced 14 more times
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):   
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     ld.lld: error: undefined symbol: stdout
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>> referenced by color_sinks.cpp
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>>               color_sinks.cpp.o:(spdlog::sinks::ansicolor_stdout_sink<spdlog::details::console_mutex>::ansicolor_stdout_sink(spdlog::color_mode)) in archive C:/Program Files/Epic Games/UE_4.26/Engine/Plugins/Marketplace/CesiumForUnreal/Source/ThirdParty/lib/Android-xaarch64\libspdlog.a
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>> referenced by color_sinks.cpp
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>>               color_sinks.cpp.o:(spdlog::sinks::ansicolor_stdout_sink<spdlog::details::console_mutex>::ansicolor_stdout_sink(spdlog::color_mode)) in archive C:/Program Files/Epic Games/UE_4.26/Engine/Plugins/Marketplace/CesiumForUnreal/Source/ThirdParty/lib/Android-xaarch64\libspdlog.a
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>> referenced by color_sinks.cpp
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>>               color_sinks.cpp.o:(spdlog::sinks::ansicolor_stdout_sink<spdlog::details::console_nullmutex>::ansicolor_stdout_sink(spdlog::color_mode)) in archive C:/Program Files/Epic Games/UE_4.26/Engine/Plugins/Marketplace/CesiumForUnreal/Source/ThirdParty/lib/Android-xaarch64\libspdlog.a
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>> referenced by color_sinks.cpp
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>>               color_sinks.cpp.o:(spdlog::sinks::ansicolor_stdout_sink<spdlog::details::console_nullmutex>::ansicolor_stdout_sink(spdlog::color_mode)) in archive C:/Program Files/Epic Games/UE_4.26/Engine/Plugins/Marketplace/CesiumForUnreal/Source/ThirdParty/lib/Android-xaarch64\libspdlog.a
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>> referenced by color_sinks.cpp
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>>               color_sinks.cpp.o:(std::__ndk1::shared_ptr<spdlog::logger> spdlog::synchronous_factory::create<spdlog::sinks::ansicolor_stdout_sink<spdlog::details::console_mutex>, spdlog::color_mode&>(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, sp
dlog::color_mode&)) in archive C:/Program Files/Epic Games/UE_4.26/Engine/Plugins/Marketplace/CesiumForUnreal/Source/ThirdParty/lib/Android-xaarch64\libspdlog.a
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>> referenced by color_sinks.cpp
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>>               color_sinks.cpp.o:(std::__ndk1::shared_ptr<spdlog::logger> spdlog::synchronous_factory::create<spdlog::sinks::ansicolor_stdout_sink<spdlog::details::console_mutex>, spdlog::color_mode&>(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, sp
dlog::color_mode&)) in archive C:/Program Files/Epic Games/UE_4.26/Engine/Plugins/Marketplace/CesiumForUnreal/Source/ThirdParty/lib/Android-xaarch64\libspdlog.a
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>> referenced by color_sinks.cpp
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>>               color_sinks.cpp.o:(std::__ndk1::shared_ptr<spdlog::logger> spdlog::synchronous_factory::create<spdlog::sinks::ansicolor_stdout_sink<spdlog::details::console_nullmutex>, spdlog::color_mode&>(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >
, spdlog::color_mode&)) in archive C:/Program Files/Epic Games/UE_4.26/Engine/Plugins/Marketplace/CesiumForUnreal/Source/ThirdParty/lib/Android-xaarch64\libspdlog.a
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>> referenced by color_sinks.cpp
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>>               color_sinks.cpp.o:(std::__ndk1::shared_ptr<spdlog::logger> spdlog::synchronous_factory::create<spdlog::sinks::ansicolor_stdout_sink<spdlog::details::console_nullmutex>, spdlog::color_mode&>(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >
, spdlog::color_mode&)) in archive C:/Program Files/Epic Games/UE_4.26/Engine/Plugins/Marketplace/CesiumForUnreal/Source/ThirdParty/lib/Android-xaarch64\libspdlog.a
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>> referenced by color_sinks.cpp
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>>               color_sinks.cpp.o:(std::__ndk1::shared_ptr<spdlog::async_logger> spdlog::async_factory_impl<(spdlog::async_overflow_policy)0>::create<spdlog::sinks::ansicolor_stdout_sink<spdlog::details::console_mutex>, spdlog::color_mode&>(std::__ndk1::basic_string<char, std::__ndk1::char_traits<ch
ar>, std::__ndk1::allocator<char> >, spdlog::color_mode&)) in archive C:/Program Files/Epic Games/UE_4.26/Engine/Plugins/Marketplace/CesiumForUnreal/Source/ThirdParty/lib/Android-xaarch64\libspdlog.a
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>> referenced by color_sinks.cpp
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>>               color_sinks.cpp.o:(std::__ndk1::shared_ptr<spdlog::async_logger> spdlog::async_factory_impl<(spdlog::async_overflow_policy)0>::create<spdlog::sinks::ansicolor_stdout_sink<spdlog::details::console_mutex>, spdlog::color_mode&>(std::__ndk1::basic_string<char, std::__ndk1::char_traits<ch
ar>, std::__ndk1::allocator<char> >, spdlog::color_mode&)) in archive C:/Program Files/Epic Games/UE_4.26/Engine/Plugins/Marketplace/CesiumForUnreal/Source/ThirdParty/lib/Android-xaarch64\libspdlog.a
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>> referenced 6 more times
PackagingResults: Error: undefined symbol: genTangSpaceDefault
PackagingResults: Error: undefined symbol: stderr
PackagingResults: Error: undefined symbol: stdout
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):   
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     ld.lld: error: undefined symbol: __gnu_strerror_r
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>> referenced by fmt.cpp
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>>               fmt.cpp.o:(fmt::v7::detail::safe_strerror(int, char*&, unsigned long)) in archive C:/Program Files/Epic Games/UE_4.26/Engine/Plugins/Marketplace/CesiumForUnreal/Source/ThirdParty/lib/Android-xaarch64\libspdlog.a
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>> referenced by fmt.cpp
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>>               fmt.cpp.o:(fmt::v7::format_system_error(fmt::v7::detail::buffer<char>&, int, fmt::v7::basic_string_view<char>)) in archive C:/Program Files/Epic Games/UE_4.26/Engine/Plugins/Marketplace/CesiumForUnreal/Source/ThirdParty/lib/Android-xaarch64\libspdlog.a
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     clang++: error: linker command failed with exit code 1 (use -v to see invocation)
PackagingResults: Error: undefined symbol: __gnu_strerror_r
PackagingResults: Error: linker command failed with exit code 1 (use -v to see invocation)
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Took 14.1143846s to run UnrealBuildTool.exe, ExitCode=6
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): UnrealBuildTool failed. See log for more details. (C:\Users\smohammed\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+Program+Files+Epic+Games+UE_4.26\UBT-CesiumForUnrealSamples-Android-Shipping.txt)
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): AutomationTool exiting with ExitCode=6 (6)
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): BUILD FAILED
PackagingResults: Error: Unknown Error
shehzan10 commented 3 years ago

Here is the packaged version of the plugin for Android and Win64. To get around GitHub issues 10mb size limit, I had to break the zip file into 10M chunks. You can use 7zip to extract them. Don't forget to remove the .txt extension after downloading.

CesiumForUnreal-Win64-Android.zip.001.txt CesiumForUnreal-Win64-Android.zip.002.txt CesiumForUnreal-Win64-Android.zip.003.txt CesiumForUnreal-Win64-Android.zip.004.txt CesiumForUnreal-Win64-Android.zip.005.txt CesiumForUnreal-Win64-Android.zip.006.txt

shehzan10 commented 3 years ago

I also tried adding ADD_DEFINITIONS(-D__ANDROID__) in the android toolchain file as well as PublicDefinitions.AddRange in the Build.cs files, so that it would explicitly set the Android flags in spdlog (https://github.com/gabime/spdlog/search?q=android), but that still runs into the same issue. Not sure if I missed any spots. Did not push this update to GitHub. Diff below.

diff --git a/CesiumForUnreal.uplugin b/CesiumForUnreal.uplugin
index d394b7b..0fa6176 100644
--- a/CesiumForUnreal.uplugin
+++ b/CesiumForUnreal.uplugin
@@ -15,6 +15,7 @@
        "IsBetaVersion": false,
        "IsExperimentalVersion": false,
        "Installed": false,
+       "SupportedTargetPlatforms": [ "Win64", "Mac", "Linux", "Android" ],
        "Modules": [
                {
                        "Name": "CesiumRuntime",
diff --git a/Source/CesiumEditor/CesiumEditor.Build.cs b/Source/CesiumEditor/CesiumEditor.Build.cs
index 905e47c..45d1da1 100644
--- a/Source/CesiumEditor/CesiumEditor.Build.cs
+++ b/Source/CesiumEditor/CesiumEditor.Build.cs
@@ -42,6 +42,12 @@ public class CesiumEditor : ModuleRules
             platform = "Android-xaarch64";
             libPostfix = ".a";
             libPrefix = "lib";
+            PublicDefinitions.AddRange(
+               new string[]
+                   {
+                       "__ANDROID__"
+                   }
+            );
         }
         else if(Target.Platform == UnrealTargetPlatform.Linux) {
             platform = "Linux-x64";
diff --git a/Source/CesiumRuntime/CesiumRuntime.Build.cs b/Source/CesiumRuntime/CesiumRuntime.Build.cs
index 1e680a7..f333b54 100644
--- a/Source/CesiumRuntime/CesiumRuntime.Build.cs
+++ b/Source/CesiumRuntime/CesiumRuntime.Build.cs
@@ -1,4 +1,5 @@
 // Copyright 2020-2021 CesiumGS, Inc. and Contributors
+// Copyright 2020-2021 CesiumGS, Inc. and Contributors

 using UnrealBuildTool;
 using System;
@@ -42,6 +43,12 @@ public class CesiumRuntime : ModuleRules
             platform = "Android-xaarch64";
             libPostfix = ".a";
             libPrefix = "lib";
+            PublicDefinitions.AddRange(
+               new string[]
+                   {
+                       "__ANDROID__"
+                   }
+            );
         }
         else if(Target.Platform == UnrealTargetPlatform.Linux) {
             platform = "Linux-x64";
diff --git a/extern/unreal-android-toolchain.cmake b/extern/unreal-android-toolchain.cmake
index f50918e..c1263df 100644
--- a/extern/unreal-android-toolchain.cmake
+++ b/extern/unreal-android-toolchain.cmake
@@ -13,3 +13,4 @@ SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
 SET(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

 SET(HTTPLIB_USE_OPENSSL_IF_AVAILABLE OFF)
+ADD_DEFINITIONS(-D__ANDROID__)
baothientran commented 3 years ago

@shehzan10 for spdlog, can you try to replace this line with something like

pLogger->sinks() = { std::make_shared<spd::sinks::android_sink_mt>() };

That will replace our unreal sink with spdlog's android sink

javagl commented 3 years ago

I think it should not be necessary to replace the SpdlogUnrealLoggerSink: This is an implementation of the spdlog sink that forwards the log messages to UE_LOG (wherever this ends up on Android - it's a hyper-complex macro, but will be available on Android in one form or the other). I.e. the purpose of this sink is exactly to not forward to stdout or stderr.

A wild guess would be that spdlog tries to create its default sink under the hood, when the "default logger" is initialized, and this sink (i.e. one of the color_sinks) assumes stdout/stderr. But... I'd (naively) assume that it should not do this when __ANDROID__ is defined....

(In the worst case, we might not use the spdlog::default_logger() and have to replace it with spdlog::android_logger_mt(...), but that's hard to imagine...)

Some of the messages seem to stem from draco, though:

UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     ld.lld: error: undefined symbol: stderr
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>> referenced by kd_tree_attributes_decoder.cc
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):     >>>               kd_tree_attributes_decoder.cc.o:(bool draco::FloatPointsTreeDecoder::DecodePointCloud<draco::PointAttributeVectorOutputIterator<float> >(draco::DecoderBuffer*, draco::PointAttributeVectorOutputIterator<float>&)) in archive C:/Program Files/Epic Games/UE_4.26/Engine/Plugins/Marketplac

From a quick glance at this file, draco uses an own log macro that forwards to printf by default, but seems to forward to Android when #ifdef ANDROID_LOGGING.

kring commented 3 years ago

Big 👍 to everything Marco said.

shehzan10 commented 3 years ago

Opened #443 as a draft PR for anyone else to try it out.

shehzan10 commented 3 years ago

Looks like MikkTSpace is not available for Android. According to our UDN thread for compiling on android: (don't forget to click "Show more answers")

It isn't used for mobile and therefore wasn't built for Android. You cannot use the Linux arm libraries on Android.

Since this is CMake-based it wouldn't be hard to compile libraries for Android and add a target check for Android to the Build.cs to set the proper lib path. Android toolchain expects you to list all the architecture directories and it will filter out the ones not needed for each architecture target.


      else if (Target.Platform = UnrealTargetPlatform.Android)
      {
          PublicAdditionalLibraries.Add(Path.Combine(MikkTSpacePath, "lib/Android/armeabi-v7a/libMikkTSpace.a"));
          PublicAdditionalLibraries.Add(Path.Combine(MikkTSpacePath, "lib/Android/arm64/libMikkTSpace.a"));
          PublicAdditionalLibraries.Add(Path.Combine(MikkTSpacePath, "lib/Android/x86/libMikkTSpace.a"));
          PublicAdditionalLibraries.Add(Path.Combine(MikkTSpacePath, "lib/Android/x86_64/libMikkTSpace.a"));
      }

I don't think we want to use custom builds. AFAICT UE only ships MikkTSpace header and not the C/C++ file, so we can't compile using their either. So our possible options are:

CC @kring

kring commented 3 years ago

Use MikkTSpace as a dependency that we compile ourselves - possibly in Cesium Native.

I think this one is sensible. Right now Cesium for Unreal generates normals and tangents for glTFs that don't have them already. But I think it would make a lot of sense for cesium-native to do that instead. There should be flags in TilesetContentOptions requesting normals and tangents, because not all rendering engines will need them.

shehzan10 commented 3 years ago

@kring Agree with that. I think we should make that change separate from this PR, and merge that into this.

javagl commented 3 years ago

Use MikkTSpace as a dependency that we compile ourselves

I wonder whether this might lead to similar trouble as the current "duplicate sqlite" libraries...? (Maybe it's possible to more strictly separate the toolchains for Android<->NonAndroid cases, or this is a C++ library that can be wrapped into another namespace or so... but I'm wondering...)

kring commented 3 years ago

It very well might, Marco. Especially since UE seems to have customized their version slightly again (ugh). I'm nearly at the moment where I can find out for sure, though.

n-baja commented 3 years ago

I just wanted to mention this, in case no one has run into this yet. In Unreal, you can change the render settings to emulate your Android settings. image

When I do this, it crashes for me and gives me this error: image

kring commented 3 years ago

Aside from potential problems getting this ont to the Marketplace (#472) and the fact that the UE SunSky doesn't work on Android and we potentially need a replacement (#495), this is complete. Closing.

Aeromix commented 3 years ago

@kring This is marked as done, however I cannot get it to compile. Does this meaning of done, mean the Android version works? I have tried the version in the comments posted as text links and the Branch, and neither will successfully package for Android. Am I misunderstanding something? Thanks!

kring commented 3 years ago

@Aeromix builds from main should work (including package) on Android. But you must use UE 4.26.2, earlier releases won't be able to package. And that's why the release of Cesium for Unreal on the Epic Marketplace doesn't support Android yet. We're working on that.

Aeromix commented 3 years ago

@kring Ahhh, perfect! I am using 4.26.1, time to upgrade! Thank you!

Aeromix commented 3 years ago

@kring Okay, so I downloaded and compiled a fresh 4.26.2 and dropped in the "android-ndk-21b" branch into EngineDir/Plugins/Marketplace. and I recieve these errors on building:

Am I missing a step?

image

kring commented 3 years ago

@Aeromix the contents of the git repo are not ready to be installed into the Engine/Plugins/Marketplace directory. The plugin needs to be built and packaged first to be installed as an engine plugin. Our CI system does that automatically. Click the green tick at the top of any branch, then download the "plugin-package-combined":

image

I recommend you use the main branch, not android-ndk-21b. So the download link as of this writing is: https://builds-cesium-unreal.s3.amazonaws.com/CesiumForUnreal-v1.4.0-21-g8f33758.zip?AWSAccessKeyId=AKIARTC57YNRHBJ2GKGG&Signature=Y4mDSCjd%2FF6A2IpKEfQg%2F4P4s4I%3D&Expires=1941077784

I'd also recommend using Epic's official 4.26.2 build rather than compiling your own, if possible. At least until you confirm that works, because I don't know what additional problems a custom build might cause.

Aeromix commented 3 years ago

@kring, this worked perfectly, thank you so much! :)

OoKushoO commented 3 years ago

I have been trying to use this plugin for oculus quest, but facing some issues with that. I have been able to test this on a mobile phone, If i enable vulkan it just crashes when the application starts, but if i use it with open gl , then it does not crash, but everything is black? any one has tried to do it for VR.

Aeromix commented 3 years ago

I have been trying to use this plugin for oculus quest, but facing some issues with that. I have been able to test this on a mobile phone, If i enable vulkan it just crashes when the application starts, but if i use it with open gl , then it does not crash, but everything is black? any one has tried to do it for VR.

I used Vulkan. Try Vulkan only, disable ES3.1, make sure HDR is off, Instanced Stereo and Multi-View/Mobile Multi-View is on. It works on Vulkan, can confirm

OoKushoO commented 3 years ago

okay thanks. I am using source engine though, I hope that does not make any difference. and did you do it for VR ?

Aeromix commented 3 years ago

okay thanks. I am using source engine though, I hope that does not make any difference.

Same: 4.26.2 off GitHub, from 2 days ago

OoKushoO commented 3 years ago

okay thanks. I am using source engine though, I hope that does not make any difference.

Same: 4.26.2 off GitHub, from 2 days ago

and for VR ?

Aeromix commented 3 years ago

okay thanks. I am using source engine though, I hope that does not make any difference.

Same: 4.26.2 off GitHub, from 2 days ago

and for VR ?

Yes, Quest 2, and tbh be prepared, the performance is not the best, it's alriiiiiiight, but it def wouldn't pass for Oculus release guidelines

OoKushoO commented 3 years ago

okay thanks. I am using source engine though, I hope that does not make any difference.

Same: 4.26.2 off GitHub, from 2 days ago

and for VR ?

Yes, Quest 2, and tbh be prepared, the performance is not the best, it's alriiiiiiight, but it def wouldn't pass for Oculus release guidelines

yeah... well i am not surprised though. Thanks for the help