From Art to Engine with Model I/O

Similar documents
What s New in Metal, Part 2

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

Understanding M3G 2.0 and its Effect on Producing Exceptional 3D Java-Based Graphics. Sean Ellis Consultant Graphics Engineer ARM, Maidenhead

CS354 Computer Graphics Character Animation and Skinning

Metal for Ray Tracing Acceleration

SceneKit in Swift Playgrounds

Tutorial: Accessing Maya tools

Zappar's coordinate system is based on the center of the scene being the center of the target image.

SceneKit: What s New Session 604

3D Production Pipeline

Working with Metal Overview

Tutorial: Exporting characters (Maya)

gltf - what the? Concepts An overview of the basics of the GL Transmission Format Page 1 gltf 2.0 Quick Reference Guide Binary data references

CGDD 4113 Final Review. Chapter 7: Maya Shading and Texturing

You can also export a video of what one of the cameras in the scene was seeing while you were recording your animations.[2]

Integrating Physics into a Modern Game Engine. Object Collision. Various types of collision for an object:

Introducing Metal 2. Graphics and Games #WWDC17. Michal Valient, GPU Software Engineer Richard Schreyer, GPU Software Engineer

1 INTRoduCTIon to BLENDER 1. 3 PREPARATIon 19

Chapter 9 Animation System

MODELING AND HIERARCHY

Integrating Apps and Content with AR Quick Look

Content. Building Geometry Appearance Lights Model Loaders

Lesson 01 Polygon Basics 17. Lesson 02 Modeling a Body 27. Lesson 03 Modeling a Head 63. Lesson 04 Polygon Texturing 87. Lesson 05 NURBS Basics 117

The Application Stage. The Game Loop, Resource Management and Renderer Design

About the FBX Exporter package

Building a Game with SceneKit

VISIT FOR THE LATEST UPDATES, FORUMS & MORE ASSETS.

Game Programming. Bing-Yu Chen National Taiwan University

EECE 478. Learning Objectives. Learning Objectives. Rasterization & Scenes. Rasterization. Compositing

Building Visually Rich User Experiences

Shaders : the sky is the limit Sébastien Dominé NVIDIA Richard Stenson SCEA

Underwater Manager (Optional)

Metal for OpenGL Developers

Content. Building Geometry Appearance Lights Model Loaders

Motivation MGB Agenda. Compression. Scalability. Scalability. Motivation. Tessellation Basics. DX11 Tessellation Pipeline

CHAPTER 1 Graphics Systems and Models 3

What s New in SpriteKit

WebGL Seminar: O3D. Alexander Lokhman Tampere University of Technology

Real-Time Universal Capture Facial Animation with GPU Skin Rendering

Introduction to Shaders.

Computer graphics 2: Graduate seminar in computational aesthetics

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]

3D Rendering Pipeline

DirectX 11 First Elements

Transformation Hierarchies. CS 4620 Lecture 5


Art? 2 Computer Graphics 2 The Stages of Production 4 The CG Production Workflow 8 Core Concepts 10 Basic Film Concepts 21 Summary 26

RSX Best Practices. Mark Cerny, Cerny Games David Simpson, Naughty Dog Jon Olick, Naughty Dog

Working With Metal Advanced

Hands-On Workshop: 3D Automotive Graphics on Connected Radios Using Rayleigh and OpenGL ES 2.0

character design pipeline) callum.html

CS 352: Computer Graphics. Hierarchical Graphics, Modeling, And Animation

Research Method: I plan to research existing literature on the subject and conducting tests in the lab.

Scene Graphs. COMP 575/770 Fall 2010

Efficient GPU Rendering of Subdivision Surfaces. Tim Foley,

Next-Generation Graphics on Larrabee. Tim Foley Intel Corp

COMP371 COMPUTER GRAPHICS

Engineering Real- Time Applications with Wild Magic

CMSC 425: Lecture 10 Skeletal Animation and Skinning

Chapter 5 - The Scene Graph

Real - Time Rendering. Graphics pipeline. Michal Červeňanský Juraj Starinský

Learning Autodesk Maya The Modeling & Animation Handbook. Free Models From Turbo Squid Value US $ Official Autodesk Training Guide

Character animation Christian Miller CS Fall 2011

CS230 : Computer Graphics Lecture 4. Tamar Shinar Computer Science & Engineering UC Riverside

Game Graphics & Real-time Rendering

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

M3G Overview. Tomi Aarnio Nokia Research Center

Hierarchical Modeling and scene graphs

Pipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11

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

Viewport 2.0 API Porting Guide for Locators

Easy Decal Version Easy Decal. Operation Manual. &u - Assets

Mixamo Maya-Auto-Control-Rig

Today s Agenda. Basic design of a graphics system. Introduction to OpenGL

CS 775: Advanced Computer Graphics. Lecture 4: Skinning

Ryan Marcotte CS 499 (Honours Seminar) March 16, 2011

Direct Rendering of Trimmed NURBS Surfaces

B x. Interoperability Chart Version 2011 LEGEND. Perfect compatibility. Data (Converted) compatibility. Emulated (Bake) compatibility.

Craig Peeper Software Architect Windows Graphics & Gaming Technologies Microsoft Corporation

B-KD Trees for Hardware Accelerated Ray Tracing of Dynamic Scenes

Enhancing Traditional Rasterization Graphics with Ray Tracing. March 2015

CS 381 Computer Graphics, Fall 2012 Midterm Exam Solutions. The Midterm Exam was given in class on Tuesday, October 16, 2012.

Tutorial: Exporting characters (Max)

Building scalable 3D applications. Ville Miettinen Hybrid Graphics

Skinned Instancing. Bryan Dudash

Copyright Khronos Group Page 1

Pipeline Operations. CS 4620 Lecture 14

Pipeline and Modeling Guidelines

CS345/DIGM465: Computer Game Development: Understanding Torque

Content Loader Introduction

3D Modeling: Skinning

move object resize object create a sphere create light source camera left view camera view animation tracks

Hierarchical Modeling

3D Modelling: Animation Fundamentals & Unit Quaternions

GAM 223 Game Design Workshop. Project 3D Maze Level Design DUE DATE: / / Design, Modeling & UV unwrapping

OPENGL RENDERING PIPELINE

CS 354R: Computer Game Technology

Shaders (some slides taken from David M. course)

Streaming Massive Environments From Zero to 200MPH

CS451Real-time Rendering Pipeline

Transcription:

Session Graphics and Games #WWDC17 From Art to Engine with Model I/O 610 Nick Porcino, Game Technologies Engineer Nicholas Blasingame, Game Technologies Engineer 2017 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple.

Model I/O Apple's toolkit for building pipelines Import and export 3D assets Geometry, materials, lighting, cameras, voxels Data format conversions Processing tools

Model I/O What's new? NEW Improved Importers Skinned Character Animation Blend Shapes Transform Stacks

Model I/O Intuitive Asset Traversal Format independent graph MDLAsset Logical Consistent Home Camera Sun Light Car Root Chassis Body Painted metal Suspension... Wheel Wheel Wheel Wheel Rubber Rubber Rubber Rubber

Art Assets Models, materials, animations Textures Scenes composed of many files

From Art to Engine Art asset is like source code Compiled for an engine

From Art to Engine UI based tools Easy the first few times Overwhelming during revision

How can the work be scaled?

Introducing the Pipeline Export the art Artwork Asset Engine-Ready Data Exporter

Introducing the Pipeline Transform the asset Artwork Asset Engine-Ready Data Tool

Introducing the Pipeline Load engine-ready data Artwork Asset Engine-Ready Data Engine

Introducing the Pipeline Export the art Artwork Asset Engine-Ready Data Exporter

Introducing the Pipeline Exporter Maya Asset Exporter Complex hierarchies of files Export script in the sample Art Asset

Introducing the Pipeline Exporter Maya Asset Exporter Complex hierarchies of files Export script in the sample Art USD

Universal Scene Description http://openusd.org

Universal Scene Description Composition Shot Layer Car Wheel Master_1 Master_2 Tire Wall Pit Building Pit Building Race Track Race Track

Universal Scene Description Classes, Variations, and Overrides shadingvariant modelingvariant

Universal Scene Description Powerful Text Format, Fast Binary over "World" { over "anim" { over "chars" { def "Car" ( add references = @chars/car.usd@</car> ) { color3f displaycolor = (0.9, 0, 0) } } } }

Introducing the Pipeline Scriptable command line tool Artwork Asset Engine-Ready Data Tool

Introducing the Pipeline Scriptable command line tool Asset Engine-Ready Data

Introducing the Pipeline Scriptable command line tool Repeatable Asset Engine-Ready Data

Introducing the Pipeline Scriptable command line tool Repeatable Consistent Asset Engine-Ready Data

Introducing the Pipeline Scriptable command line tool Repeatable Consistent Scriptable Asset Engine-Ready Data

Introducing the Pipeline Scriptable command line tool Repeatable Consistent Scriptable Scalable Asset Engine-Ready Data

Introducing the Pipeline Scriptable command line tool Repeatable Consistent Scriptable Scalable Asset Engine-Ready Data Composable

Introducing the Pipeline The sample Demonstrates principles Simplified data Uncompressed Good jumping-off point Asset Engine-Ready Data

Introducing the Pipeline Game engine Artwork Asset Engine-Ready Data Engine

Game Engine Simple renderer Single-pass forward renderer Physically-based shader Mesh instancing Skinned and animated meshes Multiple materials

Render Loop Set Transform Buffer Set Skinning Data Set Vertex Buffer C Set Pipeline State D Set Material Uniforms Set Fragment Textures Draw Indexed Primitive

The Pipeline Artwork Asset Engine-Ready Data Baker

Baking Operations 1. Geometry + Transforms 2. Texture Paths + Materials 3. Instancing Data 4. Transform Animation 5. Skinning + Character Animation

Baking Operations 1. Geometry + Transforms 2. Texture Paths + Materials 3. Instancing Data 4. Transform Animation 5. Skinning + Character Animation

Geometry + Transform A simple scene graph Transform Hierarchy Tree of nodes A Meshes and transform objects B C D

Geometry + Transform Transform hierarchy Moving the parent will move the children A B C D

Geometry + Transform Compactly encode transform hierarchy A B C D

Geometry + Transform Array of local transforms A B A C D Local Transforms

Geometry + Transform Array of local transforms A B A B C D Local Transforms

Geometry + Transform Array of local transforms A B A B C C D Local Transforms

Geometry + Transform Array of local transforms A B A B C C D D Local Transforms

Geometry + Transform Assign indices A B A 0 B 1 C C 2 D D 3 Local Transforms

Geometry + Transform Array of parent indices A B A 0 B 1 - C C 2 D D 3 Local Transforms Parent Indices

Geometry + Transform Array of parent indices A B A 0 B 1-0 C C 2 D D 3 Local Transforms Parent Indices

Geometry + Transform Array of parent indices A B A 0 B 1-0 C C 2 1 D D 3 1 Local Transforms Parent Indices

Geometry + Transform Array of parent indices A B A 0 B 1-0 C C 2 1 D D 3 1 Local Transforms Parent Indices

Geometry + Transform Array of mesh indices A B A 0 - B 1 0 C C 2 1 2 D D 3 1 Local Transforms Parent Indices Mesh Indices

Geometry + Transform Array of mesh indices A B A 0 - B 1 0 C C 2 1 2 D D 3 1 3 Local Transforms Parent Indices Mesh Indices

Geometry + Transform Mesh data Descriptor Vertex Buffers Index Buffer Descriptor Vertex Buffers Index Buffer

Geometry + Transform Vertex buffers //for every mdlobject in MDLAsset: if let mesh = mdlobject as? MDLMesh { vertexdescriptors.append(mesh.vertexdescriptor) for vertexbuffer in mesh.vertexbuffers { let vertexbufferdata = Data(bytes: vertexbuffer.map().bytes, count: vertexbuffer.length)... } for submesh in mesh.submeshes! { if let indexbuffer = (submesh as? MDLSubmesh)?.indexBuffer { let indexbufferdata = Data(bytes: indexbuffer.map().bytes, count: indexbuffer.length)... } } }

Geometry + Transform Vertex buffers //for every mdlobject in MDLAsset: if let mesh = mdlobject as? MDLMesh { vertexdescriptors.append(mesh.vertexdescriptor) for vertexbuffer in mesh.vertexbuffers { let vertexbufferdata = Data(bytes: vertexbuffer.map().bytes, count: vertexbuffer.length)... } for submesh in mesh.submeshes! { if let indexbuffer = (submesh as? MDLSubmesh)?.indexBuffer { let indexbufferdata = Data(bytes: indexbuffer.map().bytes, count: indexbuffer.length)... } } }

Geometry + Transform Vertex buffers //for every mdlobject in MDLAsset: if let mesh = mdlobject as? MDLMesh { vertexdescriptors.append(mesh.vertexdescriptor) for vertexbuffer in mesh.vertexbuffers { let vertexbufferdata = Data(bytes: vertexbuffer.map().bytes, count: vertexbuffer.length)... } for submesh in mesh.submeshes! { if let indexbuffer = (submesh as? MDLSubmesh)?.indexBuffer { let indexbufferdata = Data(bytes: indexbuffer.map().bytes, count: indexbuffer.length)... } } }

Geometry + Transform Index buffer //for every mdlobject in MDLAsset: if let mesh = mdlobject as? MDLMesh { vertexdescriptors.append(mesh.vertexdescriptor) for vertexbuffer in mesh.vertexbuffers { let vertexbufferdata = Data(bytes: vertexbuffer.map().bytes, count: vertexbuffer.length)... } for submesh in mesh.submeshes! { if let indexbuffer = (submesh as? MDLSubmesh)?.indexBuffer { let indexbufferdata = Data(bytes: indexbuffer.map().bytes, count: indexbuffer.length)... } } }

Geometry + Transform Local transform var localtransforms: [matrix_float4x4] = [] // for every mdlobject in MDLAsset: if let transform = mdlobject.transform { localtransforms.append(transform.matrix) }

Geometry + Transform Local transform var localtransforms: [matrix_float4x4] = [] // for every mdlobject in MDLAsset: if let transform = mdlobject.transform { localtransforms.append(transform.matrix) }

Geometry + Transform Mesh Data Descriptors Vertex + Index Buffers Scene Composition Data Parent Indices, Mesh Indices Transform Data Local Transforms

Baking Operations 1. Geometry + Transforms 2. Texture Paths + Materials 3. Instancing Data 4. Transform Animation 5. Skinning + Character Animation

Texture Paths + Materials Materials stored on MDLSubmesh Fetch properties referenced by shader Record texture paths and values MDLSubmesh MDLMaterial MDLMesh AO Base Color Metallic

Texture Paths + Materials // for every submesh: if let material = submesh.material { } for property in material.properties(with:<mdlmaterialsemantic>) { if property.type ==.string property.type ==.URL { // texture } else if property.type == <MDLMaterialPropertyType> { // uniform value } }

Texture Paths + Materials // for every submesh: if let material = submesh.material { } for property in material.properties(with:<mdlmaterialsemantic>) { if property.type ==.string property.type ==.URL { // texture } else if property.type == <MDLMaterialPropertyType> { // uniform value } }

Texture Paths + Materials Mesh Data Descriptors Vertex + Index Buffers Scene Composition Data Parent Indices, Mesh Indices Transform Data Local Transforms

Texture Paths + Materials Mesh Data Descriptors Vertex + Index Buffers Scene Composition Data Parent Indices, Mesh Indices Transform Data Local Transforms Material Data Material Uniforms Texture Paths

Baking Operations 1. Geometry + Transforms 2. Texture Paths + Materials 3. Instancing Data 4. Transform Animation 5. Skinning + Character Animation

Instancing A mesh can be used multiple times A B C D

Instancing A mesh can be used multiple times A B C D E

Instancing A mesh can be used multiple times Why store it multiple times? A B C D E

Instancing Masters Masters MDLAsset has a masters array A B C D E

Instancing Model I/O support Masters MDLObject instance pointers refer to masters A B C D E

Instancing Masters A 0 - A AB 1 0 B C 2 1 2 C D 3 1 3 D E 4 0 4 E Local Transforms Parent Indices Mesh Indices

Instancing Masters A 0 - A AB 1 0 B C 2 1 2 C D 3 1 3 D E 4 0 4 E Local Transforms Parent Indices Mesh Indices

Instancing Masters A 0 - A AB 1 0 B C 2 1 2 C D 3 1 4 D E 4 0 3 E Local Transforms Parent Indices Mesh Indices

Instancing Masters A 0 - A AB 1 0 B C 2 1 2 C D 3 1 4 2 D E 4 0 3 1 E Local Transforms Parent Indices Mesh Indices Instance Count

Instancing Mesh Data Descriptors Vertex + Index Buffers Scene Composition Data Parent Indices, Mesh Indices Transform Data Local Transforms Material Data Material Uniforms Texture Paths

Instancing Mesh Data Descriptors Vertex + Index Buffers Scene Composition Data Parent Indices, Mesh Indices Instance Count Transform Data Local Transforms Material Data Material Uniforms Texture Paths

Demo Geometry, Materials, and Instancing Nicholas Blasingame, Game Technologies Engineer

Baking Operations 1. Geometry + Transforms 2. Texture Paths + Materials 3. Instancing Data 4. Transform Animation 5. Skinning + Character Animation

Transform Animation Transforms that vary over time A B C D

Transform Animation A B C D

Transform Animation Sample the animations A t0, t1 tn B B C D D Animated Local Transforms

Transform Animation var localtransforms: [matrix_float4x4] = [] // for every mdlobject in MDLAsset: if let transform = mdlobject.transform { localtransforms.append(transform.matrix) }

Transform Animation var localtransforms: [matrix_float4x4] = [] // for every mdlobject in MDLAsset: if let transform = mdlobject.transform { localtransforms.append(transform.matrix) } if (transform.keytimes.count > 1) { let sampledxm = sampletimes.map{ transform.localtransform!(attime: $0) } animatedlocaltransforms.append(sampledxm)... }

Transform Animation var localtransforms: [matrix_float4x4] = [] // for every mdlobject in MDLAsset: if let transform = mdlobject.transform { localtransforms.append(transform.matrix) } if (transform.keytimes.count > 1) { let sampledxm = sampletimes.map{ transform.localtransform!(attime: $0) } animatedlocaltransforms.append(sampledxm)... }

Transform Animation Mesh Data Descriptors Vertex + Index Buffers Scene Composition Data Parent Indices, Mesh Indices Instance Count Transform Data Local Transforms Material Data Material Uniforms Texture Paths

Transform Animation Mesh Data Descriptors Vertex + Index Buffers Scene Composition Data Parent Indices, Mesh Indices Instance Count Transform Data Local Transforms Animated Local Transforms Material Data Material Uniforms Texture Paths

Baking Operations 1. Geometry + Transforms 2. Texture Paths + Materials 3. Instancing Data 4. Transform Animation 5. Skinning + Character Animation

Skinned Character Animation

Skinned Character Animation

Skinned Character Animation Mesh has geometry

Skinned Character Animation Embedded skeleton

Skinned Character Animation Vertex weighting to joints

Skinned Character Animation Vertex weighting to joints

Skinned Character Animation Vertex blending in shader {... float4 position = vertex.pos; packed_uchar4 jidx = vertex.jointindices; packed_float4 w = vertex.jointweights; float4 skinnedposition = w[0] * (palette[jidx[0]] * modelposition) + w[1] * (palette[jidx[1]] * modelposition) + w[2] * (palette[jidx[2]] * modelposition) + w[3] * (palette[jidx[3]] * modelposition); }...

Skinned Character Animation Input vertex attributes {... float4 position = vertex.pos; packed_uchar4 jidx = vertex.jointindices; packed_float4 w = vertex.jointweights; float4 skinnedposition = w[0] * (palette[jidx[0]] * modelposition) + w[1] * (palette[jidx[1]] * modelposition) + w[2] * (palette[jidx[2]] * modelposition) + w[3] * (palette[jidx[3]] * modelposition); }...

Skinned Character Animation Per vertex joint indices {... float4 position = vertex.pos; packed_uchar4 jidx = vertex.jointindices; packed_float4 w = vertex.jointweights; float4 skinnedposition = w[0] * (palette[jidx[0]] * modelposition) + w[1] * (palette[jidx[1]] * modelposition) + w[2] * (palette[jidx[2]] * modelposition) + w[3] * (palette[jidx[3]] * modelposition); }...

Skinned Character Animation Indexed bones for weight each vertex {... float4 position = vertex.pos; packed_uchar4 jidx = vertex.jointindices; packed_float4 w = vertex.jointweights; float4 skinnedposition = w[0] * (palette[jidx[0]] * modelposition) + w[1] * (palette[jidx[1]] * modelposition) + w[2] * (palette[jidx[2]] * modelposition) + w[3] * (palette[jidx[3]] * modelposition); }...

Skinned Character Animation A B C D E Root Skeleton Body Wheel 1 Wheel 2

Skinned Character Animation E Root Skeleton Body Wheel 1 Wheel 2

Skinned Character Animation E Root Skeleton Body Wheel 1 Wheel 2

Skinned Character Animation E Root 0 Skeleton Body Wheel 1 1 2 Wheel 2 3

Skinned Character Animation E Root 0 - Skeleton Body Wheel 1 1 2 0 1 Wheel 2 3 1 Joint Parent Indices

Skinned Character Animation Bind Poses + Joint Indices E Root 0 - Body 1 0 1 B1-1 Skeleton Wheel 1 2 1 2 B2-1 Wheel 2 3 1 3 B3-1 Joint Parent Indices Bound Joint Indices Inverse Bind Pose

Skinned Character Animation Bind Poses + Joint Indices E Root 0 - Body 1 0 1 B1-1 Skeleton Wheel 1 2 1 2 B2-1 Wheel 2 3 1 3 B3-1 Joint Parent Indices Bound Joint Indices Inverse Bind Pose

Skinned Character Animation Bind Poses + Joint Indices E Root 0 - Body 1 0 1 B1-1 Skeleton Wheel 1 2 1 2 B2-1 Wheel 2 3 1 3 B3-1 Joint Parent Indices Bound Joint Indices Inverse Bind Pose

Skinned Character Animation Time sample animation E Root 0 - Root t0 tn Body 1 0 1 B1-1 Body t0 tn Skeleton Wheel 1 2 1 2 B2-1 W1 t0 tn Wheel 2 3 1 3 B3-1 W2 t0 tn Joint Parent Indices Bound Joint Indices Inverse Bind Pose Animation Clip

Skinned Character Animation // for every mdlobject in MDLAsset: if let mesh = mdlobject as? MDLMesh { if let skin = object.componentconforming(to:mdlskindeformercomponent.self) as? MDLSkinDeformerComponent { let inversebindtransforms = skin.jointbindtransforms().map{simd_inverse($0)} }...

Skinned Character Animation // for every mdlobject in MDLAsset: if let mesh = mdlobject as? MDLMesh { if let skin = object.componentconforming(to:mdlskindeformercomponent.self) as? MDLSkinDeformerComponent { let inversebindtransforms = skin.jointbindtransforms().map{simd_inverse($0)} }...

Skinned Character Animation Mesh Data Descriptors Vertex + Index Buffers Scene Composition Data Parent Indices, Mesh Indices Instance Count Transform Data Local Transforms Animated Local Transforms Material Data Material Uniforms Texture Paths

Skinned Character Animation Mesh Data Descriptors Vertex + Index Buffers Scene Composition Data Parent Indices, Mesh Indices Instance Count Transform Data Local Transforms Animated Local Transforms Animation Clips Material Data Skinning Data Material Uniforms Texture Paths Inverse Bind Transforms Joint to Palette Mapping Skeleton Parent Indices

Demo Instancing and Characters

Recap Artwork Asset Engine Ready Data USD

Enhancements Light Mapping

Enhancements Light Mapping UV Unwrapping

Enhancements Light Mapping UV Unwrapping Ambient Occlusion

Enhancements Image-based lighting

More Information https://developer.apple.com/wwdc17/610

Related Information Managing 3D Assets with Model I/O WWDC 2015 Introducing Metal 2 WWDC 2017 What s New in SceneKit WWDC 2017