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

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

Advanced Graphics and Animation

AGDC Per-Pixel Shading. Sim Dietrich

How to Work on Next Gen Effects Now: Bridging DX10 and DX9. Guennadi Riguer ATI Technologies

05 Mesh Animation. Steve Marschner CS5625 Spring 2016

2.11 Particle Systems

Animation. Motion over time

3D Programming. 3D Programming Concepts. Outline. 3D Concepts. 3D Concepts -- Coordinate Systems. 3D Concepts Displaying 3D Models

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

Computer Animation. Conventional Animation

CS 4621 PPA3: Animation

Ray Cast Geometry. RayCast Node for Motion, Displacements and Instancing. New to The Ray Cast Geometry node has received an upgrade for 2018.

Animation of 3D surfaces.

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

Chapter 9 Animation System

3D Overlay Specifications (Formerly 3D Guidelines)

Animation of 3D surfaces

Game Programming. Bing-Yu Chen National Taiwan University

Black Desert Online. Taking MMO Development to the Next Level. Dongwook Ha Gwanghyeon Go

Interactive Cloth Simulation. Matthias Wloka NVIDIA Corporation

CS 450: COMPUTER GRAPHICS TEXTURE MAPPING SPRING 2015 DR. MICHAEL J. REALE

DX10, Batching, and Performance Considerations. Bryan Dudash NVIDIA Developer Technology

Character animation Christian Miller CS Fall 2011

Bringing Hollywood to Real Time. Abe Wiley 3D Artist 3-D Application Research Group

Soft Particles. Tristan Lorach

CMSC 425: Lecture 10 Skeletal Animation and Skinning

CS451Real-time Rendering Pipeline

Texturing Theory. Overview. All it takes is for the rendered image to look right. -Jim Blinn 11/10/2018

The Vegetation of Horizon Zero Dawn. Gilbert Sanders Principal Artist, Guerrilla Games

Canonical Shaders for Optimal Performance. Sébastien Dominé Manager of Developer Technology Tools

Hardware Displacement Mapping

Designing the look and feel for Smoke and Neon powers The creation of a new toolset and pipeline for I:SS Pros and cons from our new workflow and

Animation Essentially a question of flipping between many still images, fast enough

3D Production Pipeline

3D Rendering Pipeline

About Phoenix FD PLUGIN FOR 3DS MAX AND MAYA. SIMULATING AND RENDERING BOTH LIQUIDS AND FIRE/SMOKE. USED IN MOVIES, GAMES AND COMMERCIALS.

Building scalable 3D applications. Ville Miettinen Hybrid Graphics

CS 523: Computer Graphics, Spring Shape Modeling. Skeletal deformation. Andrew Nealen, Rutgers, /12/2011 1

Com S 336 Final Project Ideas

Data passed from a source application is recognized by the destination application, yielding identical results. Data (Converted) compatibility

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]

Animation. CS 465 Lecture 22

NVIDIA Tools for Artists

Craig Peeper Software Architect Windows Graphics & Gaming Technologies Microsoft Corporation

Animation COM3404. Richard Everson. School of Engineering, Computer Science and Mathematics University of Exeter

GUERRILLA DEVELOP CONFERENCE JULY 07 BRIGHTON

Input Nodes. Surface Input. Surface Input Nodal Motion Nodal Displacement Instance Generator Light Flocking

Real-Time Rendering (Echtzeitgraphik) Michael Wimmer

Optimizing and Profiling Unity Games for Mobile Platforms. Angelo Theodorou Senior Software Engineer, MPG Gamelab 2014, 25 th -27 th June

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

Gettin Procedural. Jeremy Shopf 3D Application Research Group

C P S C 314 S H A D E R S, O P E N G L, & J S RENDERING PIPELINE. Mikhail Bessmeltsev

CSE452 Computer Graphics

Render-To-Texture Caching. D. Sim Dietrich Jr.

A Trip Down The (2011) Rasterization Pipeline

Real-Time Buffer Compression. Michael Doggett Department of Computer Science Lund university

Shader Series Primer: Fundamentals of the Programmable Pipeline in XNA Game Studio Express

Chapter 9- Animation Basics

CS4620/5620: Lecture 14 Pipeline

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

Human body animation. Computer Animation. Human Body Animation. Skeletal Animation

Chapter Adding 1- T Mo he tio B n le to nde Yo r ur Inte Scerfac ne e Landscape Scene Stormy Night.mp4 End 200 Default Animation frame 1 Location

Lecture 16. Introduction to Game Development IAP 2007 MIT

Pump Up Your Pipeline

Baback Elmieh, Software Lead James Ritts, Profiler Lead Qualcomm Incorporated Advanced Content Group

Computer Graphics (CS 543) Lecture 10: Normal Maps, Parametrization, Tone Mapping

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

Advanced Lighting Techniques Due: Monday November 2 at 10pm

Procedural Shaders: A Feature Animation Perspective

The Rasterization Pipeline

Animation. CS 4620 Lecture 33. Cornell CS4620 Fall Kavita Bala

The Graphics Pipeline

Skinning Mesh Animations

CS 4620 Midterm, March 21, 2017

Computer graphics 2: Graduate seminar in computational aesthetics

Module Contact: Dr Stephen Laycock, CMP Copyright of the University of East Anglia Version 1

To build shapes from scratch, use the tools are the far right of the top tool bar. These

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

Rendering. Converting a 3D scene to a 2D image. Camera. Light. Rendering. View Plane

Evolution of GPUs Chris Seitz

Chapter 13 - Modifiers

NVIDIA Developer Toolkit. March 2005

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

Analyze and Optimize Windows* Game Applications Using Intel INDE Graphics Performance Analyzers (GPA)

Approximating Subdivision Surfaces with Gregory Patches for Hardware Tessellation

Real-World Applications of Computer Arithmetic

Rendering Objects. Need to transform all geometry then

2D & 3D Animation NBAY Donald P. Greenberg March 21, 2016 Lecture 7

Image Morphing. The user is responsible for defining correspondences between features Very popular technique. since Michael Jackson s clips

Approximate Catmull-Clark Patches. Scott Schaefer Charles Loop

animation computer graphics animation 2009 fabio pellacini 1 animation shape specification as a function of time

animation computer graphics animation 2009 fabio pellacini 1

Computer Graphics. Si Lu. Fall uter_graphics.htm 11/27/2017

Drawing a Crowd. David Gosselin Pedro V. Sander Jason L. Mitchell. 3D Application Research Group ATI Research

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

Cloth Simulation on the GPU. Cyril Zeller NVIDIA Corporation

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

Scanline Rendering 2 1/42

UNIVERSITAT POLITÈCNICA DE CATALUNYA DEPARTAMENT DE LLENGUATGES I SISTEMES INFORMÀTICS MASTER IN COMPUTING MASTER THESIS

Transcription:

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

Dark Ages before Textures in the Vertex Shader What is the Vertex Shader? A programmable part of the graphic pipeline Vertex properties can be modified Position Normal Vertex color UVs

Dark Ages before Textures in the Vertex Shader No textures in vertex shader :( Use vert attributes instead, such as vertex color and UVs. Vert Positions Normals Pivot Points

Textures in Vertex Shader Since DirectX 11 we can cheaply sample textures in the vertex shader. Typical use case: Displacement Map Example from UE4 documentation

Textures in Vertex Shader However there are more interesting use cases! Pixels are cells of information Vectors of 3 or 4 elements Different levels of precision The data in a texture can be used for different things. Be creative!

Some Simple but Creative Uses Where does the rain stop? Read the height from map Reset Z animation

Some Simple but Creative Uses Fixed-to-the-ground meshes Read the height from map Add as an offset to the mesh Easy to place for artists

Some Simple but Creative Uses Fixed-to-the-ground meshes Before Now

Some Simple but Creative Uses Smoke animation in a texture Baking XYZ of the hand as RGB Each frame is a pixel Uncompressed texture Position normalized: 0 to 1 Position scaled back in the shader Collaboration with Simon Trümpler

Some Simple but Creative Uses Smoke animation in a texture Smoke has several rings of height Bottom ring reads current pixel/frame Previous pixels for rings above

Pre-calculated Particle Animation 4001 particles 180 frames of animation

Pre-calculated Particle Animation Positions as pixels Each pixel is a position Each row is a frame Each column is the position of a vertex along time

Pre-calculated Particle Animation Texture Dimension: 4001x180 Texture Size: 2813 KB Texture Format: B8G8R8A8 Bilineal filtering of texture used to interpolate between positions Optimization: Reduce it vertically (half) by deleting every other frame.

Pre-calculated Particle Animation Uncompressed texture XYZ as RGB Normalized values to fit in the 0 to 1 range Positions are scaled back in the shader Precision is obviously lost For additional precision a 16 bit texture can be used instead.

Pre-calculated Rigid Object Animation

Pre-calculated Rigid Object Animation Pivoting Groups of vertices sharing a pivot Every vertex in a group shares movement Memory improvement over brute force

Pre-calculated Rigid Object Animation 32 objects 128 frames of animation 1 Texture for Position, 1 for Rotation Texture Dimension: 32x128 Texture Size: 16KB Pos + 16KB Rot Texture Format: B8G8R8A8 Quaternion as RGBA Optimization: Reduce it vertically (half) by deleting every other frame.

Vertex-count-agnostic Morph Targets

Vertex-count-agnostic Morph Targets The position texture Each row of pixels is a morph target This is a cropped portion of the vert position texture

Vertex-count-agnostic Morph Targets Every pixel represents a vert position. Three pixels represent one triangle. If three pixels are black it means that that triangle is not needed for that frame and so its vert positions will be 0,0,0. The triangle will virtually cease to exist.

Vertex-count-agnostic Morph Targets The Morphing In the shader we don t linearly interpolate, instead we jump to the next morph

Vertex-count-agnostic Morph Targets Optimization: Triangle Pairing We can reduce the memory footprint by pairing as many triangles as possible. We can reduce up to 33%

Vertex-count-agnostic Morph Targets Optimization: But ideally... We should have different options of geometry compression

Advantages of Textures as data containers

Drawbacks of Textures as data containers

Thinking about Baking animation and cloth simulation Huge amount of vertex data Compress the data depending on the amount of movement But during a pee-break I had an idea

The Idea! What if we transform simulations into bone animation? What if we put the bone transformation data into a texture?

Can We Actually Do It? The skinning of the mesh is already being done in the GPU So theoretically, yes But we need to have access to all the information the CPU provides to the GPU in the conventional way Through mesh and texture information

To achieve that Info needed Store the translation of bones

To achieve that Info needed Store the translation of bones A texture

To achieve that Info needed Store the translation of bones Store the rotation of bones A texture

To achieve that Info needed Store the translation of bones Store the rotation of bones A texture Another texture

To achieve that Info needed Store the translation of bones Store the rotation of bones Store the weighting of the vertices A texture Another texture

To achieve that Info needed Store the translation of bones Store the rotation of bones Store the weighting of the vertices A texture Another texture UV channels

To achieve that Info needed Store the translation of bones Store the rotation of bones Store the weighting of the vertices Store the index of the relevant bones A texture Another texture UV channels

To achieve that Info needed Store Store Store Store the the the the translation of bones rotation of bones weighting of the vertices index of the relevant bones A texture Another texture UV channels Vertex color

To achieve that Info needed Store the translation of bones Store the rotation of bones Store the weighting of the vertices Store the index of the relevant bones Store the initial offset of the bones A texture Another texture UV channels Vertex color

To achieve that Info needed Store Store Store Store Store the the the the the translation of bones rotation of bones weighting of the vertices index of the relevant bones initial offset of the bones A texture Another texture UV channels Vertex color More textures!

How We Actually Do It

How We Actually Do It Read the indices of bones affecting the vertex from the vertex color (limitation of 256 bones)

How We Actually Do It Read the influence of those bones over the vertex from the UV channels

How We Actually Do It Read the position and rotation of those bones from both textures We use the object position and the original bone offset from the texture to calculate final positions

How We Actually Do It We have all what we need to do apply the linear skinning algorithm

Final result A full animation

Final result Through another lens We can take a look at the textures that create the previous animation

What Are The Numbers? How much animation can we store in a texture? Can we handle facial animation for all the cinematics? Which frame rate are we talking about?

What Are The Numbers? 166 minutes Of facial animation (56 bones) In two 4096x4096 textures (rotation and translation) 30 frames per second

What Are The Numbers? 21 minutes Of awesome facial animation (450 bones) In two 4096x4096 textures (rotation and translation) 30 frames per second

Future Improvements Road map Normal Solving Animation Blending Bone Scaling Compression

Future Improvements Improve Normal Solving Rotating the normal by the quaternion of the bone is the simplest way to recalculate normals, but there are more accurate solutions

Future Improvements Implement Animation Blending The presented solution is useful for cinematic animations, but some improvements can be made to support animation blending.

Future Improvements Support Bone Scaling Transformation and rotation is already supported but we can add scaling with the use of another texture.

Future Improvements Enhance Compression We are storing information for each frame (30 fps), but that can be improved with a smarter compression and interpolation system.

Final Thoughts Know your tools Textures can be used as data containers Approach problems from different perspectives

Annex This technique uses bone information. What about blendshapes or simulations? This issue is already solved by other people that also inspired our work: https://vimeo.com/123883474

Thanks! Any questions? You can find us at Twitters: @sindromequijote @Norman3D Emails: mario.palmero@tequilaworks.com norman3d@gmail.com