All Projects → HMS-Core → hms-scene-RTcore-demo

HMS-Core / hms-scene-RTcore-demo

Licence: Apache-2.0 License
This demo provides examples of how to use RTCore APIs, including using them to create reflection effects and draw triangles.

Programming Languages

C++
36643 projects - #6 most used programming language
GLSL
2045 projects
CMake
9771 projects
java
68154 projects - #9 most used programming language
c
50402 projects - #5 most used programming language
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to hms-scene-RTcore-demo

hms-av-pipeline-demo
HUAWEI AV Pipeline Kit sample code project, which contains the Java sample code to implement functions like video playback, video super-resolution and media asset management. C++ sample code is contained for calling MediaFilter to use the sound event detection plugin.
Stars: ✭ 14 (+7.69%)
Mutual labels:  huawei, hms
hms-location-demo
HUAWEI Location Kit sample code encapsulates APIs of the HUAWEI Location Kit. It provides many sample programs for your reference or usage.
Stars: ✭ 32 (+146.15%)
Mutual labels:  huawei, hms
huawei-account-demo
Sample code for quickly integrate Huawei ID. HUAWEI Account Kit provides developers with simple, secure, and quick sign-in and authorization functions.
Stars: ✭ 39 (+200%)
Mutual labels:  huawei, hms
hms-health-demo-java
HMS Health demo code provides demo programs for your reference or usage. Developers can access the Huawei Health Platform and obtain sports & health data by integrating HUAWEI Health.
Stars: ✭ 37 (+184.62%)
Mutual labels:  huawei, hms
hms-scene-demo
HMS Scene kit demo provides an example of integrating HUAWEI Scene Kit with an app. A 3D graphics rendering engine performs more with less. User-friendly rendering APIs for games, AR & VR apps, and other apps bring your users a stunning visual experience.
Stars: ✭ 18 (+38.46%)
Mutual labels:  huawei, hms
hms-health-demo-kotlin
HMS Health demo code provides demo programs for your reference or usage. Developers can access the Huawei Health Platform and obtain sports & health data by integrating HUAWEI Health.
Stars: ✭ 21 (+61.54%)
Mutual labels:  huawei, hms
hms-react-native-plugin
This repo contains all of React-Native HMS plugins.
Stars: ✭ 167 (+1184.62%)
Mutual labels:  huawei, hms
hms-FIDO-demo-java
HMS FIDO demo, including fido2 demo, bioauthn demo and bioauthn-androidx demo.
Stars: ✭ 17 (+30.77%)
Mutual labels:  huawei, hms
map-kit-android
An extensive framework for map development in Android.
Stars: ✭ 44 (+238.46%)
Mutual labels:  huawei, hms
hms-iap-clientdemo-android-studio
This demo app provides all 3 types of product to demonstrate the procedure and capability of Huawei IAP.
Stars: ✭ 36 (+176.92%)
Mutual labels:  huawei, hms
hms-3d-modeling-demo
HUAWEI 3D Modeling Kit project contains a sample app. Guided by this demo, you will be able to implement full 3D Modeling Kit capabilities, including 3D object reconstruction and material generation.
Stars: ✭ 45 (+246.15%)
Mutual labels:  huawei, hms
hms-computer-graphics-demo
This is the demo project of CGKit(Short for computer graphics kit). CGKit is a vulkan-based rendering framework, which is designed to improve performance of vulkan devices, especially for Android platform. This project will show you how to load textures, models, add pbr effects and render with vulkan.
Stars: ✭ 19 (+46.15%)
Mutual labels:  huawei, hms
hms-cordova-plugin
This repo contains all of Cordova HMS plugins.
Stars: ✭ 78 (+500%)
Mutual labels:  huawei, hms
hms-safetydetect-demo-android
SafetyDetect Sample provides many sample programs for your reference or usage.This example demonstrates how to integrate services provided by Safetydetect Kit, such as APPchecks, URLcheck, Userdetect, Wifidetect.
Stars: ✭ 16 (+23.08%)
Mutual labels:  huawei, hms
hms-ads-demo-kotlin
HUAWEI Ads Kit Sample code in kotlin version, which provides the banner, native, rewarded, roll, interstitial and splash ad formats for integration
Stars: ✭ 16 (+23.08%)
Mutual labels:  huawei, hms
hms-push-serverdemo-csharp
C# sample code encapsulates APIs of the HUAWEI Push Kit server. It provides many sample programs for your reference or usage.
Stars: ✭ 25 (+92.31%)
Mutual labels:  huawei, hms
hms-audio-editor-demo
HUAWEI Audio Kit provides a wide range of audio editing capabilities, including auido import/export/editing/extracting and format conversion. This sample code describes how to integrate the Audio Editor Kit SDK.
Stars: ✭ 24 (+84.62%)
Mutual labels:  huawei, hms
hms-push-serverdemo-php
PHP sample code encapsulates APIs of the HUAWEI Push Kit server.It provides many sample PHP programs about quick access to HUAWEI Push Kit for your reference or usage.
Stars: ✭ 21 (+61.54%)
Mutual labels:  huawei, hms
hms-video-editor-demo
HUAWEI Video Editor Kit provides full video editing functions like video import/export, editing and rendering. This sample code is used to describe how to integrate the Video Editor Kit SDK.
Stars: ✭ 45 (+246.15%)
Mutual labels:  huawei, hms
hms-iap-serverdemo
IAP server sample encapsulates APIs of the HUAWEI IAP server. It provides many sample programs for your reference or usage. The repository contains 8 branches of java, csharp, golang, nodejs, perl, php, python and ruby demo.
Stars: ✭ 20 (+53.85%)
Mutual labels:  huawei, hms

Sample Codes for RTCore

中文 | English

Contents

Introduction

This project mainly demonstrates how to use RTCore APIs to build hybrid rendering pipelines and simulate partial reflection in ray tracing. It provides two demos: one for drawing a triangle using RTCore APIs, and the other for implementing physically based rendering (PBR) pipelines and simulating partial reflection based on hybrid rendering. In this project, we make use of Vulkan by referring to SaschaWillems' VulkanExample[1] project. In the demo of drawing a triangle, the primary ray for each pixel on the screen is calculated by referring to Ray Tracing in One Weekend[3]. PBR-related functions are implemented by referring to LearnOpenGL[2].

Compilation

The two demos have been tested on Android / Harmony OSplatforms and contain all necessary configuration files. Android / Harmony OS platform 1. Development Environment

  • Android studio 4.0 or later
  • ndk 20.1.5948944 or later
  • Android SDK 29.0.0 or later

2. Compile and Run

2.1 using IDE

Open android in Android Studio and synchronize the project. Run the project to generate the APK and install it on a phone. Then launch the app to check whether it works as expected.

2.2 using command line

adb connect with mobile phone and run following.

cd android
call .\gradlew clean
call .\gradlew installDebug 	# or `call .\gradlew assembleDebug` for just build apk
adb shell am start -n "com.huawei.rtcore.vkhybridrt/.VulkanActivity"

Demos

Drawing a Triangle using Ray Tracing

This demo shows you how to use RTCore APIs to calculate the intersections between primary rays and triangles, to replace the original rasterization method. Below is the detailed procedure.

1. Use the generatePrimary function in RaytracingTriangle.cpp to calculate primary rays in the World Coordinate System (WCS) based on the camera coordinates and pixel coordinates.

2. Use the updateRayBuffers function in RaytracingTriangle.cpp to copy rays from CPU to GPU.

3. Build bvh and calculate the ray intersections. This task includes three steps: performing initialization, building an acceleration structure, and calculating the ray intersections, framed in red in the preceding figure. In this demo, RTCore APIs is used in the VulkanTraceRay class.

  • The prepare function obtains compute queue and call the Setup function of RTCore to perform initialization.
  • buildBVH(vertices, indices, modelMatrix) first converts vertex coordinates into WCS coordinates, and then calls the CreateBLAS and CreateTLAS functions to build the bottom-level and top-level acceleration structures, respectively.
  • The trayRay function calls the TraceRays API of RTCore to calculate the ray intersections and get the calculation result. Below is the result.

4. Use graphics pipelines to virtualize the intersections. That is, call the triangle/VulkanTrianglePipeline class to process pixels one by one, obtain the intersection calculation result, and show the intersections in a specific color.

Simulating Partial Reflection Based on Hybrid Rendering

This demo builds a set of ray tracing-based hybrid rendering pipelines to implement partial reflection. Below is the detailed procedure.

1. Use the traditional rasterization method to implement PBR pipelines (as shown in the area framed by yellow dotted lines). Here is the code:

  • examples/hybridreflection/VulkanScenePipeline
  • examples/hybridreflection/VulkanImageBasedLighting
  • examples/hybridreflection/VulkanSkyboxPipeline;

2. Add a raytraing pipeline to generate reflection texture which builds of resources that RTCore needs. Then generate gays, intersect with scene objects, get color and return a reflection texture in shader codes.

  • examples/hybridreRayTracing/RayTracingPass
  • data/shaders/glsl/hybridRayTracing/raytracing_color.frag

3. Use a hybrid pipeline to fuse specular maps and images displayed by original graphics pipelines.

  • examples/hybridreRayTracing/VulkanOnscreenPipeline

Below is an example of partial reflection:

Reference_Projects

[1] https://github.com/SaschaWillems/Vulkan

[2] learnOpenGL/PBR

[3] https://raytracing.github.io/books/RayTracingInOneWeekend.html

License

The sample code is licensed under Apache License 2.0. Please refer to LICENSE.md for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].