Scene Kit, SceneView Function and Integration

Gürkan Orduluoğlu
Huawei Developers
Published in
4 min readSep 28, 2020

As you can imagine, you can create 3D games and add 3D content to apps using high-level scene descriptions. You can easily add animations, physics simulation, particle effects, and realistic physically based rendering. This SceneKit is a kit that comes into our lives with HMS Core 5.0.

A lightweight rendering engine that features high performance and low power consumption. Comprehensive graphics rendering services, with open capabilities covering from the hardware system layer to the software platform layer.

System layer

High-performance APIs efficiently support Vulkan/OpenGL ES, dramatically improving the rendering performance.

Software platform layer

iGraphics Rendering provides high-performance rendering capabilities.

Capability openness layer

Scene Kit provides 3D apps with lightweight and efficient rendering services, with open APIs suitable for various scenarios.

Application layer

Scene Kit enables you to quickly obtain rendering capabilities in various scenarios, such as gaming, design, and entertainment.

HUAWEI Scene Kit is a lightweight 3D graphics rendering service provided by Huawei. You can easily access this Kit by integrating its SDK/Full-SDK. Then you can load and display complicated 3D objects on Android phones as desired by calling necessary APIs. To meet your different requirements on 3D rendering capabilities in various scenes, Scene Kit provides three types of views: SceneView for common scenes (non-AR), ARView for common AR scenes, and FaceView for face-specific AR scenes.

SceneKit combines a high-performance rendering engine with a descriptive API for import, manipulation, and rendering of 3D assets. Unlike lower-level APIs such as Metal and OpenGL that require you to implement in precise detail the rendering algorithms that display a scene, SceneKit requires only descriptions of your scene’s contents and the actions or animations you want it to perform.

Before start to integrate, I want to say very important thing, if you already build this kit on your device, if it will not work stable, don’t panic !! Maybe, your codes are working well, but your device is not support this SceneKit.

You can see devices which are supported bellow.

Supported Huawei Devices

I already tell before “Integrating the HMS Core SDK” in my old medium post, which has “https://medium.com/huawei-developers-tr/huawei-location-kiti-ve-entegrasyonu-f05286d0f0d3” link. You can use this link for reference.

lets start to development;

1)Create an Android Studio project.

Permission for Other Functions

2)if you will integrate other two functions (ARView and FaceView features) need permission to use the camera. So, lets add the permission on Manifest file.

permission for camera

3)Configure the Maven repository address in the project-level build.gradle file.

4) Configure the Scene SDK as a dependency in the app-level build.gradle file.

Then, Please Synchronize the project.

SceneView Function

Scene Kit uses SceneView to provide you with rendering capabilities that automatically adapt to 3D scenes. To complete the rendering of a complex 3D scene, you only need to call several APIs.

5)Let’s create a SampleView that inherits from SceneView.

6)Let’s create a SampleView by registering it in the Layout xml file.

7)Override the surfaceCreated method and call the below super method to initialize the SceneView.

8)In the surfaceCreateed method that is generated after overriding, call the methods to load 3D materials and maps.

No need for clear method, because original materials are automatically cleared.

9)Determine whether to override the surface lifecycle-related methods as needed.

after completed all steps , you can use SceneView to load and display 3D materials.

you can see the output of application Screen Shots like below.

Main Menu & SceneView Function

Some FAQs

1)What are the criteria for using HUAWEI Scene Kit?

Three criteria: (1) your phone has HMS Core (APK) of the required version installed; (2) your phone supports the Vulkan API; (3) your app has integrated the HMS Core Scene SDK. If you want to know what devices HUAWEI Scene Kit supports, please check include of my medium article.

2) Is HUAWEI Scene Kit free of charge?

Yes. All APIs provided by the HMS Core Scene SDK are free of charge.

3) Does HUAWEI Scene Kit involve user privacy?

During loading, parsing, rendering, and display of materials, HUAWEI Scene Kit does not collect, store, or upload material information so that user privacy is not involved.

4) Where will 3D materials be placed in a scene after being loaded? Can they be resized or moved?

In this version (1.5.0.300), they are placed at the center of your scene by default. You can pinch to zoom in or out on the materials, but cannot adjust their positions. Position adjustment will be supported in later versions.

5) Why does the skybox/lighting maps materials fail to be loaded by calling the loadSkyBox/loadSpecularEnvTexture/loadDiffuseEnvTexture method?

In this version (1.5.0.300), HUAWEI Scene Kit only supports skybox/lighting maps materials in dds cubemap format. Check whether your skybox/lighting maps materials are in the required format.

In this my Medium post, I’ve tried to explain what is the Scene Kit which is in HMS Core 5.0? what is working for ? and how to integrate SceneView function? I hope, it will be useful for you.
I’ll see you in my next Medium article.

References:

--

--