Announcement

Collapse
No announcement yet.

Getting Procedural and/or CustomMeshComponent to work

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Getting Procedural and/or CustomMeshComponent to work

    Hello everyone,

    first of all I'm sorry if this has been asked and answered before but I couldn't find any information regarding problems with Procedural/CustomMeshComponent specifically related to Android.

    So I'm currently evaluating ways to generate meshes on Android and in the process tried both Custom and ProceduralMeshComponent plugins. Unfortunately neither of those seem to work on my test device (it's an ODYS Lux 10 tablet with Android 5.0 [Lollipop], 1.3GHz Quad Core, Mali-450 MP, 1 GB, 10.1"). Using Unreal Engine 4.9.1

    I've created a new blank Blueprint project (without starter content) and added a new Blueprint derived from (A)Actor. I've attached both a CustomMeshComponent and a ProceduralMeshComponent to the DefaultSceneRoot Component in the Components panel and moved both mesh components to different positions. Now in the Event Graph I am overriding/implementing the BeginPlay function/event. Here I am generating a few triangles (two per mesh, one facing up, the other one down to guarantee one should always be visible if I look at them) and set them using "Set Custom Mesh Triangles" and "Create Mesh Section". Running this on my device either through "Launch On Device" from the editor or by packaging and installing the apk via the Install_<Project>_Development-armv7-es2.bat works fine except the triangles are not visible/rendered correctly. However on "Play In Editor" and "Play Standalone Game" on Windows it works as expected, the triangles are rendered and visible.

    On the device I then used the stat RHI command to see the number of DrawPrimitive calls and Triangles drawn. By doing so I've noticed that the Triangles drawn count changes by 2 and the DrawPrimitive calls count by 1 if the ProceduralMeshComponent is no longer on screen. The CustomMeshComponent is always rendered (2 Triangles drawn, 1 DrawPrimitive call). I've check this by comparing the counts with the component and after removing the component. Looking at the plugin code this is not surprising since the CustomMeshComponents do not calculate accurate bounds and instead use FBoxSphereBounds with Origin = FVector::ZeroVector, BoxExtent = FVector(HALF_WORLD_MAX,HALF_WORLD_MAX,HALF_WORLD_MAX) and SphereRadius = FMath::Sqrt(3.0f * FMath::Square(HALF_WORLD_MAX)) which is the length of the vector BoxExtent.

    Worth mentioning that i have not assigned a material to either component so it is using the default material. But I've also tested it with a simple unlit constant color material with the same result.

    So it seems like the triangles are being drawn (at least attempted to according to stats) but for some reason they aren't visible (aren't actually drawn). Am I doing something wrong? Does my device simply not support features required for this or what else would be able to cause this?

    Any information regarding this is appreciated.
    Thank you very much.
    Youtube - UnrealEverything

    Games:
    [Android] World of Bricks Released!

    [TUTORIAL] Edge Detection Post Process Effect using World Normals

    2B || !(2B)
Working...
X