Skip to content

Latest commit

 

History

History
104 lines (59 loc) · 3.67 KB

README.md

File metadata and controls

104 lines (59 loc) · 3.67 KB

Meta Spark AR Vertex Animation Textures

Description

A combination of scripts for Blender and Meta Spark AR to play back arbitrarily deformed geometry in Spark without using bones. It is super performant and flexible.

Blender 4.x Version here

Tutorial

Tutorial

Quickstart

download and unzip (or git clone) the repo.

Installing the Script in Blender

Edit > Preferences... > Add-Ons > Install...

Select vertex_animation.py

enable Spark AR VAT: Vertex Animation

Exporting an Animation

Select the animated Object

Open the Spark AR VAT Tab

select frame range and output directory

click 'Process Anim Meshes'

observe the changed 'Scale Factor' in the UI...

observe the changed 'Chunks' in the UI...

Installing the Shader in Spark AR

Enable Vertex Texture Fetch in Project > Edirt Properties... > Capabilities > + > Vertex Texture Fetch

Drag and drop SparkVAT.sca into your project

Importing an Animation

Drag and drop everything from the output directory above into your project

set compression to 'none' for all imported textures

set Sampling/Filtering to 'none' for all imported textures

make a new material with the shader and populate the outputs

assign it to the exported mesh from the output directory

enter the Scale Factor from the Blender UI in the appropriate field

enter the Chunks from the Blender UI in the appropriate field

Known Limitations

Because of Texture Size limits in Spark, the maximum framerange of the animation depends on the mesh resolution. Many animations don't need many frames, while most models have a few thousand vertices. An average walk cycle for a character is only about 30 frames.

Vertices Max Frames Seconds @25fps
<1024 1024 40
<2048 512 20
<3072 340 13
<4096 256 10
<5120 204 8
<6144 170 6
<7168 146 5
<8192 128 4
... ... ...
<16384 64 2,56
<32768 32 1,28

Vertex Order can't change between frames, which means that the mesh has to stay consistent between frames

Further Optimizations

Using ImageOptim you can further compress the generated textures about 27,5 % per file on average (up to 49,8 %). (Important to keep Quality at 100%)

You can play with manually setting texture compression in Spark AR to uncompressed GPU format such as PVRTC (iOS) / ETC2 (android) - observe if it saves data and doesn't degrade quality.

Authors

  • Mate Steinforth

Acknowledgments

  • Adapted for Spark from the Blender scripts created by Joshua Bogart
  • Adapted for Blender from 3ds Max scripts created by Jonathan Lindquist at Epic Games.
  • Triceratops model licenced under CC0 Public Domain by The Smithsonian Institute

Tech Info

If you're interested in the internals of the workflow, check Texture Animation: Applying Morphing and Vertex Animation Techniques