DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
Building Scalable Real-Time Apps with AstraDB and Vaadin
Register Now

Trending

  • Introduction To Git
  • Which Is Better for IoT: Azure RTOS or FreeRTOS?
  • Authorization: Get It Done Right, Get It Done Early
  • Comparing Cloud Hosting vs. Self Hosting

Trending

  • Introduction To Git
  • Which Is Better for IoT: Azure RTOS or FreeRTOS?
  • Authorization: Get It Done Right, Get It Done Early
  • Comparing Cloud Hosting vs. Self Hosting
  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. How to Import Volumetric Video Container Into Unity

How to Import Volumetric Video Container Into Unity

Volumetric Video Container tutorial. Let’s first begin by talking about volumetric video frames, which are different than traditional video frames.

Hamit Demir user avatar by
Hamit Demir
·
Updated Sep. 09, 20 · Tutorial
Like (3)
Save
Tweet
Share
1.99K Views

Join the DZone community and get the full member experience.

Join For Free

Volumetric Video Container

Let’s first begin by talking about volumetric video frames. Each frame of a volumetric video sequence is more different than traditional video frames.  Generally, each frame contains one reconstructed obj file, one jpg file band, one MTL file(you can check https://antmedia.io/volumetric-video/). The file sizes for 3D models can often be very large and when the number of scenes increases, most of the time, the following may happen:

  • File management for each frame gets confusing
  • Memory needs increases
  • Selecting a specific frame is extremely difficult
  • Takes a hit on the performance

Solution:

Using a combination of compressed .obj files and a wrapper we can implement a buffer for volumetric video streams which we can manage the frames. This tutorial will be a brief guide to understand how to import volumetric video container into Unity.

Implementation Details:

Getting Frame List From Container

To start warming up, here is a simple definition of a BinaryReader. Binary Reader is the class for C# reading primitive data types as binary values in a specific encoding. As we say, this specific encoding should not be considered as regular streams that store arbitrary data. To restore data, we access it as we stored it, using the same data types in the same order. Now let’s get down to business. In the following figure, there is a bird’s eye view of the structure of the frame list inside the volumetric video container:


The first thing we’ll do is to create a binary reader and write our basic frameList loop. But be careful, boost::serialization expects to take a 40-byte memory space by default at the beginning of the archive. So we utilize the first 40 bytes of the stream. The next 64 bytes correspond to the number of frames. The code is just for demo purposes. Instead of reading all parts, the same part can be reduced to hold some of the blocks wrapped in the container.


Decode Mesh With Draco

Even if it’s true that Unity developing support for 3D applications, but there is limited support for importing 3D Objects at run time fluently. We use Draco to decode frames from the container. Draco is an open-source library for compressing and decompressing 3D geometric meshes and point clouds. It’s aimed at improving 3D graphics storage. Here we read meshes from the container in 64-byte chunks and send them to the function
ConvertDracoMeshToUnity(). The structure stays the same.


Put Frames Into The Buffer

With the above code, our container is almost ready to import. However, imagine that you have thousands of frames. As all these scenes begin to load, your workspace will start to fill unnecessarily or if you want to fast forward the video, and if the frame there is not loaded, you have to wait until it loads.  We use a fixed-size queue to overcome the problem. When a new frame is imported from the container, we push forward the head pointer and when the frame is consumed, the tail pointer pushes forward. If we reach the end of the buffer, the pointers simply wrap around to the beginning. When the buffer is full, we do not import any frame until any frame is displayed and there is free space in the buffer. We’re not going to dive into the details of implementing the buffer here. After import the volumetric video container, this part can refactor for your specific purpose.

Consequently

In this post, we covered how to import Volumetric Video Container into Unity. It should not be forgotten that the container makes it very easy to move frames from one disc to another or upload/download them to/from a server. In addition, there is a difference in performance between loading a frame directly into Unity and loading it in a compressed version. We import frames really quickly so we do not take a hit on performance with Spaceport Container.

Hope you enjoyed this article.

Container Frame (networking) unity Game engine

Published at DZone with permission of Hamit Demir. See the original article here.

Opinions expressed by DZone contributors are their own.

Trending

  • Introduction To Git
  • Which Is Better for IoT: Azure RTOS or FreeRTOS?
  • Authorization: Get It Done Right, Get It Done Early
  • Comparing Cloud Hosting vs. Self Hosting

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com

Let's be friends: