Simple and Powerful Animation Compression. Nicholas Fréchette Programming Consultant for Eidos Montreal

Similar documents
[537] Fast File System. Tyler Harter

Streaming Massive Environments From Zero to 200MPH

Skinning Mesh Animations

Character animation Christian Miller CS Fall 2011

CMSC 425: Lecture 10 Skeletal Animation and Skinning

Table of Contents. Questions or problems?

CSEP 521 Applied Algorithms Spring Lossy Image Compression

MEGACACHE DOCS. Introduction. Particle Simulations. Particle Exporters. Example Videos

Outline. Register Allocation. Issues. Storing values between defs and uses. Issues. Issues P3 / 2006

The Illusion of Motion Making magic with textures in the vertex shader. Mario Palmero Lead Programmer at Tequila Works

MOTION CAPTURE DATA PROCESSING - MOTION EDITING / RETARGETING - MOTION CONTROL / GRAPH - INVERSE KINEMATIC. Alexandre Meyer Master Informatique

Chapter 9 Animation System

Video based Animation Synthesis with the Essential Graph. Adnane Boukhayma, Edmond Boyer MORPHEO INRIA Grenoble Rhône-Alpes

To Do. Advanced Computer Graphics. The Story So Far. Course Outline. Rendering (Creating, shading images from geometry, lighting, materials)

Faloutsos 1. Carnegie Mellon Univ. Dept. of Computer Science Database Applications. Outline

Course Outline. Advanced Computer Graphics. Animation. The Story So Far. Animation. To Do

File Systems Management and Examples

CS 475: Parallel Programming Introduction

Scalable Compression and Transmission of Large, Three- Dimensional Materials Microstructures

About this document. Introduction. Where does Life Forms fit? Prev Menu Next Back p. 2

EECS 482 Introduction to Operating Systems

A Comparison of Two Fully-Dynamic Delaunay Triangulation Methods

Rigging / Skinning. based on Taku Komura, Jehee Lee and Charles B.Own's slides

Breathing life into your applications: Animation with Qt 3D. Dr Sean Harmer Managing Director, KDAB (UK)

Dynamic Spatial Partitioning for Real-Time Visibility Determination. Joshua Shagam Computer Science

2. PICTURE: Cut and paste from paper

So, what is data compression, and why do we need it?

CS 4604: Introduction to Database Management Systems. B. Aditya Prakash Lecture #10: Query Processing

3/1/2010. Acceleration Techniques V1.2. Goals. Overview. Based on slides from Celine Loscos (v1.0)

Mount Points Mount Points is a super simple tool for connecting objects together and managing those relationships.

Lecture S3: File system data layout, naming

Chapter 6: File Systems

Large-scale visual recognition Efficient matching

ICS RESEARCH TECHNICAL TALK DRAKE TETREAULT, ICS H197 FALL 2013

Optimizing DirectX Graphics. Richard Huddy European Developer Relations Manager

3D Character Creation for the Unreal Game Engine Using Adobe Fuse

Bigtable: A Distributed Storage System for Structured Data. Andrew Hon, Phyllis Lau, Justin Ng

Evaluation of Relational Operations

Systems Programming and Computer Architecture ( ) Timothy Roscoe

Spatial Data Structures

Summary of Last Chapter. Course Content. Chapter 3 Objectives. Chapter 3: Data Preprocessing. Dr. Osmar R. Zaïane. University of Alberta 4

Caches Concepts Review

Computer Architecture Prof. Smruthi Ranjan Sarangi Department of Computer Science and Engineering Indian Institute of Technology, Delhi

Implementation of Relational Operations. Introduction. CS 186, Fall 2002, Lecture 19 R&G - Chapter 12

Mark Rogov, Dell EMC Chris Conniff, Dell EMC. Feb 14, 2018

Parallel Algorithm Design. Parallel Algorithm Design p. 1

Game Programming. Bing-Yu Chen National Taiwan University

A Bandwidth Effective Rendering Scheme for 3D Texture-based Volume Visualization on GPU

CSCI-GA Database Systems Lecture 8: Physical Schema: Storage

Algorithm Performance Factors. Memory Performance of Algorithms. Processor-Memory Performance Gap. Moore s Law. Program Model of Memory I

Page Replacement. (and other virtual memory policies) Kevin Webb Swarthmore College March 27, 2018

HDF5 I/O Performance. HDF and HDF-EOS Workshop VI December 5, 2002

CS354 Computer Graphics Character Animation and Skinning

Motion Graphs for Character Animation

CS 318 Principles of Operating Systems

Animations. Hakan Bilen University of Edinburgh. Computer Graphics Fall Some slides are courtesy of Steve Marschner and Kavita Bala

Introduction Disks RAID Tertiary storage. Mass Storage. CMSC 420, York College. November 21, 2006

Chapter 5.2 Character Animation

Pathfinding Decision Making

CS 318 Principles of Operating Systems

Factoring Point Clouds into Positions and Translations for Compression

CSE452 Computer Graphics

Clustering and Reclustering HEP Data in Object Databases

How TokuDB Fractal TreeTM. Indexes Work. Bradley C. Kuszmaul. MySQL UC 2010 How Fractal Trees Work 1

Broken Age's Approach to Scalability. Oliver Franzke Lead Programmer, Double Fine Productions

CS 537 Lecture 6 Fast Translation - TLBs

Animation. CS 465 Lecture 22

CAS CS 460/660 Introduction to Database Systems. Query Evaluation II 1.1

Motion Synthesis and Editing. Yisheng Chen

Optimizing for DirectX Graphics. Richard Huddy European Developer Relations Manager

Example-Based Skeleton Extraction. Scott Schaefer Can Yuksel

Welfare Navigation Using Genetic Algorithm

Cost Functions in Machine Learning

Data Preprocessing. Slides by: Shree Jaswal

About the FBX Exporter package

Chapter 6 Caches. Computer System. Alpha Chip Photo. Topics. Memory Hierarchy Locality of Reference SRAM Caches Direct Mapped Associative

Operating Systems Design Exam 2 Review: Spring 2011

Theoretical Foundations of Clustering. Margareta Ackerman

Operating Systems. Week 9 Recitation: Exam 2 Preview Review of Exam 2, Spring Paul Krzyzanowski. Rutgers University.

Introduction to Approximation Algorithms

Channels & Keyframes. CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2017

Information Retrieval

CS 416: Opera-ng Systems Design March 23, 2012

Hardware Displacement Mapping

Considerations to Accurately Measure Solid State Storage Systems

Computer Graphics II

File Systems. OS Overview I/O. Swap. Management. Operations CPU. Hard Drive. Management. Memory. Hard Drive. CSI3131 Topics. Structure.

Apache Accumulo 1.4 & 1.5 Features

Game AI: The set of algorithms, representations, tools, and tricks that support the creation and management of real-time digital experiences

Shadows for Many Lights sounds like it might mean something, but In fact it can mean very different things, that require very different solutions.

Comparing Implementations of Optimal Binary Search Trees

Maximizing Face Detection Performance

6.837 Introduction to Computer Graphics Final Exam Tuesday, December 20, :05-12pm Two hand-written sheet of notes (4 pages) allowed 1 SSD [ /17]

BONE CONTROLLER ASSET VERSION 0.1 REV 1

Operating Systems. Operating Systems Professor Sina Meraji U of T

Parallel Query Optimisation

COMP30019 Graphics and Interaction Scan Converting Polygons and Lines

SAP IQ - Business Intelligence and vertical data processing with 8 GB RAM or less

Chapter Seven Morgan Kaufmann Publishers

Code generation for modern processors

Transcription:

Simple and Powerful Animation Compression Nicholas Fréchette Programming Consultant for Eidos Montreal

Contributors Frédéric Zimmer, co-designer Luke Mamacos, consultant Thank you Eidos Montreal!

Presentation outline A bit of context

Presentation outline A bit of context The classic solutions

Presentation outline A bit of context The classic solutions Our special blend!

A bit of context The game engine used by Rise of the Tomb Raider (2015) Same compression algorithms since ~1996! Used in dozens of AAA titles Based on linear key reduction

A bit of context + Good size - Slow decompression - Sub-par accuracy

The problem Cinematic clips Need high accuracy Size matters

The problem Cinematic clips Need high accuracy Size matters Ever higher need for accuracy 40% clips used weak compression Time is the enemy

The problem Legacy code not ideal Very old, aged poorly Not streaming friendly Nobody wants to get near it

Design goals Solve cinematics first Through streaming (if we need to) Keep it simple Time budget: 20 days

Design goals Fast decompression High accuracy

Design goals Best effort Small size Nothing to tweak Supersede everything

Most common algorithm families Signal processing Curve fitting Linear key reduction Simple key quantization

Signal processing E.g. wavelets Too complex See blog!

Curve fitting

Curve fitting Pros Sensible choice Very compact

Curve fitting Cons Not accessible Slower decompression Medium complexity Not great for mocap

Linear key reduction

Linear key reduction

Linear key reduction Pros Reasonably simple Reasonably compact Similar to legacy impl.

Linear key reduction Cons Similar to legacy impl. Slow decompression Not great for mocap

Simple quantization

Simple quantization Pros Dead simple Very fast Solid foundation

Simple quantization Cons Not very compact Good enough!

Our solution Range reduction Uniform segmenting Constant tracks Quantization

Range reduction Tracks in terms of ranges E.g. my elbow rotates by 120 in a clip Theoretical range: 360 Effective range: 120

Range reduction

Range reduction

Range reduction Some overhead Range Minimum Range Extent Normalizes our values Range expansion is trivial (normalized value * extent) + min

Range reduction 6 scalar values = full track range 3 components * (min, extent) Clip metadata 6x floats = 24 bytes per animated track

Range reduction More accuracy => can be more lossy Bad for short clips Worth it!

Uniform Partitioning Split clips in blocks of 16 key frames

Uniform Partitioning Split clips in blocks of 16 key frames Fast and easy seeking

Uniform Partitioning Split clips in blocks of 16 key frames Fast and easy seeking Easy streaming

Uniform Partitioning Split clips in blocks of 16 key frames Fast and easy seeking Easy streaming Range reduction per block

Uniform Partitioning Block metadata 6x 8 bit = 48 bits = 6 bytes per animated track Lossy normalization!!

Constant Tracks For our main characters (~3500 clips)

Constant Tracks For our main characters (~3500 clips) Bones: 65% constant, 45% bind pose

Constant Tracks For our main characters (~3500 clips) Bones: 65% constant, 45% bind pose Tracks: 87% constant, 79% bind pose

Constant Tracks Per clip, 1 bit per track: Is it bind pose? Yes? Drop it!

Constant Tracks Per clip, 1 bit per track: Is it bind pose? Yes? Drop it! Per clip, 1 bit per track: Is it constant? Yes? Keep 1 key! (3x floats)

Quantization Hard coded, 16 bits

Quantization Hard coded, 16 bits Best common rate per clip

Quantization Hard coded, 16 bits Best common rate per clip Best rot/trans/scale rate per clip

Quantization Hard coded, 16 bits Best common rate per clip Best rot/trans/scale rate per clip Best rot/trans/scale rate per block

Quantization Hard coded, 16 bits Best common rate per clip Best rot/trans/scale rate per clip Best rot/trans/scale rate per block Best individual track rate per block

Variable bit rate Ideal for: Hierarchical data Exotic tracks Temporal coherence Everything!

Quantization details 16 possible bit rates Bit rates: 0, 3, 4,.., 16, 23

Quantization details 23 was a bad & naïve choice Same as float mantissa minus sign bit

Quantization details 23 was a bad & naïve choice Same as float mantissa minus sign bit De-quantization requires our integer to be representable as a floating point number

Quantization details 23 was a bad & naïve choice Same as float mantissa minus sign bit De-quantization requires our integer to be representable as a floating point number 32 bit float = 6 significant digits L

Quantization details 23 was a bad & naïve choice Same as float mantissa minus sign bit De-quantization requires our integer to be representable as a floating point number 32 bit float = 6 significant digits L 19 might be a better choice, measure!

Quantization details 0 => track is constant in block We don t need range information

Quantization details 0 => track is constant in block We don t need range information Store our constant key instead!

Compression Almost everything is fairly trivial Only complex step is bit rate selection

Compression Almost everything is fairly trivial Only complex step is bit rate selection Measuring accuracy Need a smart heuristic

Measuring accuracy Important! Our algorithm iterates with it We compare our results to others with it

Measuring accuracy Important! Our algorithm iterates with it We compare our results to others with it Often overlooked and poorly implemented!

Measuring accuracy Three important criteria: Account for hierarchy Account for aggregate transform Account for visual mesh

Measuring accuracy Hierarchy is important! Error accumulates down hierarchy Don t use local space metrics! Use object space

Measuring accuracy Aggregate error is important! Don t measure error with leaf bone position It ignores rotation/scale contribution!

Measuring accuracy Skeleton error!= visual mesh error Skeleton is never visible, visual mesh is With rotation & scale, error increases with distance from bone

Measuring accuracy

Measuring accuracy Vertex displacement on the visual mesh is the true measure of accuracy Skinning == metric function Satisfies all 3 criteria

Measuring accuracy But It is way too slow Mesh information might not be available Some bones have no skinned vertices

Measuring accuracy Use virtual vertices instead! Approximates skinning Satisfies all 3 criteria Intuitive tweaking: distance from bone Output is object space displacement error

Measuring accuracy We use: 3 cm for normal bones 1 m for high accuracy bones

Bit Rate Selection Huge search space! Need smart heuristic

Bit Rate Selection Huge search space! Need smart heuristic First pass finds an approximate solution

Bit Rate Selection Huge search space! Need smart heuristic First pass finds an approximate solution Second pass refines to local minimum

Bit Rate Selection

Bit Rate Selection

Bit Rate Selection

Bit Rate Selection

Bit Rate Selection

Bit Rate Selection

Bit Rate Selection

Bit Rate Selection

Bit Rate Selection We minimize the bit rate We maximize the error Threshold is important! 1 mm is too high

Bit Rate Selection Hardcoded threshold: 0.1 mm Sub-millimeter accuracy!

The results Aggregated Concrete examples

Aggregate Results 3900 clips (various characters) Compression time: 3.2 hours, single threaded 10 minutes, multi threaded Sum of clip lengths: 5.4 hours @ 30 FPS

Aggregate Results

Aggregate Results

Aggregate Results

Aggregate Results Total size on disk: 168.4 MB Legacy size: 300.0 MB Average number of animated tracks: 56.0 per clip

Aggregate Results

Aggregate Results

Raw Clip Size Compression ratio is meaningless Unless raw size is consistent!

Raw Clip Size Raw size = # key frames * # bones * 36 bytes

Raw Clip Size 1 track key = 3 floats = 12 bytes 1 bone key = 3 track keys = 36 bytes 1 key frame with 140 bones = 140 bone keys = 4.9 KB 30 key frames = 147.7 KB

Some concrete examples Scramble Idle Walk Cinematic Num. key frames 24 80 38 2291 Num. animated tracks 56 (11%) 77 (15%) 82 (16%) 87 (16%) Raw size 147 KB 489 KB 232 KB 14498 KB Compressed size 7 KB 15 KB 12 KB 521 KB Compression ratio 20 : 1 32 : 1 19 : 1 28 : 1 Avg key frame size 314 B 194 B 325 B 233 B Decompression (XB1) 28us 32us 33us 27us

Some concrete examples Scramble Idle Walk Cinematic Num. key frames 24 80 38 2291 Num. animated tracks 56 (11%) 77 (15%) 82 (16%) 87 (16%) Raw size 147 KB 489 KB 232 KB 14498 KB Compressed size 7 KB 15 KB 12 KB 521 KB Compression ratio 20 : 1 32 : 1 19 : 1 28 : 1 Avg key frame size 314 B 194 B 325 B 233 B Decompression (XB1) 28us 32us 33us 27us

Some concrete examples Scramble Idle Walk Cinematic Num. key frames 24 80 38 2291 Num. animated tracks 56 (11%) 77 (15%) 82 (16%) 87 (16%) Raw size 147 KB 489 KB 232 KB 14498 KB Compressed size 7 KB 15 KB 12 KB 521 KB Compression ratio 20 : 1 32 : 1 19 : 1 28 : 1 Avg key frame size 314 B 194 B 325 B 233 B Decompression (XB1) 28us 32us 33us 27us

Some concrete examples Scramble Idle Walk Cinematic Num. key frames 24 80 38 2291 Num. animated tracks 56 (11%) 77 (15%) 82 (16%) 87 (16%) Raw size 147 KB 489 KB 232 KB 14498 KB Compressed size 7 KB 15 KB 12 KB 521 KB Compression ratio 20 : 1 32 : 1 19 : 1 28 : 1 Avg key frame size 314 B 194 B 325 B 233 B Decompression (XB1) 28us 32us 33us 27us

Some concrete examples Scramble Idle Walk Cinematic Num. key frames 24 80 38 2291 Num. animated tracks 56 (11%) 77 (15%) 82 (16%) 87 (16%) Raw size 147 KB 489 KB 232 KB 14498 KB Compressed size 7 KB 15 KB 12 KB 521 KB Compression ratio 20 : 1 32 : 1 19 : 1 28 : 1 Avg key frame size 314 B 194 B 325 B 233 B Decompression (XB1) 28us 32us 33us 27us

Conclusion Sweet spot Very fast decompression Reasonably compact High accuracy Future proof

Conclusion Versatile Works out of the box Nothing to tweak No need for fallback alternative

Conclusion Simple Implemented in 20-25 days No maintenance Easy to build on and improve

Questions? Blog: http://nfrechette.github.io/