Huawei Scene Kit

Neha Jeswani
Huawei Developers
Published in
4 min readFeb 5, 2021

--

Huawei Scene Kit is a wonderful set of API’s which allows 3D models to display on a mobile screen while converting the 3D models adopting physical based rendering (PBR) pipelines to achieve realistic rendering effects.

What makes a beautiful game loaded with top notch graphics, what makes virtual reality meeting rooms, what makes moving objects and space representation?

I am sure, this would have made you wonder!!

This is possible with 3D image rendering.

3D image rendering is a process to convert any 3D model (which is also done using computer software) into a 2D view on a computer/mobile screen, however ensuring the actual feel of the 3D model.

There are many tools and software to do the conversions on a system but very few supports the same process on an Android Mobile device.

Huawei Scene Kit is a wonderful set of API’s which allows 3D models to display on a mobile screen while converting the 3D models adopting physical based rendering (PBR) pipelines to achieve realistic rendering effects.

Features

Uses physical based rendering for 3D scenes with quality immersion to provide realistic effects.

Offers API’s for different scenarios for easier 3D scene construction which makes the development super easy.

Uses less power for equally powerful scene construction using a 3D graphics rendering framework and algorithms to provide high performance experience.

How does Huawei Scene Kit Works

The SDK of Scene Kit, after being integrated into your app, will send a 3D materials loading request to the Scene Kit APK in HMS Core (APK). Then the Scene Kit APK will verify, parse, and render the materials.

Scene Kit also provides a Full-SDK, which you can integrate into your app to access 3D graphics rendering capabilities, even though your app runs on phones without HMS Core.

Scene Kit uses the Entity Component System (ECS) to reduce coupling and implement multi-threaded parallel rendering.

Real-time PBR pipelines are adopted to make rendered images look like in a real world.

The general-purpose GPU Turbo is supported to significantly reduce power consumption.

Huawei Scene Kit supports 3 types of different rendering mechanism

SceneView

ARView

FaceView

Development Overview

Prerequisite

Must have a Huawei Developer Account

Must have Android Studio 3.0 or later

Must have a Huawei phone with HMS Core 4.0.2.300 or later

EMUI 3.0 or later

Software Requirements

Java SDK 1.7 or later

Android 5.0 or later

Supported Devices

Supported 3D Formates

Materials to be rendered: glTF, glb

glTF textures: png, jpeg

Skybox materials: dds (cubemap)

Lighting maps: dds (cubemap)

Note: These materials allow for a resolution of up to 4K.

Preparation

Create an app or project in the Huawei app gallery connect.

Provide the SHA Key and App Package name of the project in App Information Section and enable the required API.

Create an Android project.

Note: Scene Kit SDK can be directly called by devices, without connecting to AppGallery Connect and hence it is not mandatory to download and integrate the agconnect-services.json.

Integration

Add below to build.gradle (project)file, under buildscript/repositories and allprojects/repositories.

Maven {url ‘http://developer.huawei.com/repo/'}

Add below to build.gradle (app) file, under dependencies.

To use the SDK of Scene Kit, add the following dependencies:

Adding permissions

<uses-permission android:name=”android.permission.CAMERA “ />

Development Process

This article focus on demonstrating the capabilities of Huawei’s Scene Kit: Scene View API’s.

Here is the example which explains how we can integrate a simple 3D Model (Downloaded from the free website: https://sketchfab.com/ ) with Scene View API’s to showcase the space view of AMAZON Jungle.

Download and add supported 3D model into the App’s asset folder.

Main Activity

Launcher activity for the application which has a button to navigate and display the space view.

Space View Activity

It’s a java class which holds the logic to render the 3D models using the API’s and display them in a surface view.

Results

Conclusion

We learnt a simple application which demonstrate the Scene View API’s and showcase how easy it is to have the 3D models shown on the applications.

References

https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/service-introduction-0000001050163355

--

--