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

Similar documents
Billboards!! A texture mapped polygon, which always faces the viewer

Advanced Graphics and Animation

Animation. Computer Graphics COMP 770 (236) Spring Instructor: Brandon Lloyd 4/23/07 1

Shaders. Slide credit to Prof. Zwicker

CS GAME PROGRAMMING Question bank

CS 4621 PPA3: Animation

Blue colour text questions Black colour text sample answers Red colour text further explanation or references for the sample answers

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

Rasterization Overview

Comp 410/510 Computer Graphics Spring Programming with OpenGL Part 4: Three Dimensions

Com S 336 Final Project Ideas

Sign up for crits! Announcments

CS770/870 Spring 2017 Animation Basics

CS770/870 Spring 2017 Animation Basics

Shadows. Prof. George Wolberg Dept. of Computer Science City College of New York

TSBK 07! Computer Graphics! Ingemar Ragnemalm, ISY

2.11 Particle Systems

Computer Science 175. Introduction to Computer Graphics lib175 time: m/w 2:30-4:00 pm place:md g125 section times: tba

CS451Real-time Rendering Pipeline

Computer Graphics (CS 563) Lecture 4: Advanced Computer Graphics Image Based Effects: Part 1. Prof Emmanuel Agu

I expect to interact in class with the students, so I expect students to be engaged. (no laptops, smartphones,...) (fig)

OPENGL AND GLSL. Computer Graphics

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

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

Animation. Representation of objects as they vary over time. Traditionally, based on individual drawing or photographing the frames in a sequence

Agenda. Introduction Curve implementation. Particle System. - Requirements -What are all those vectors? -Where should I put things?

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

Vulkan and Animation 3/13/ &height=285&playerId=

NVIDIA Parallel Nsight. Jeff Kiel

Computer Graphics - Treasure Hunter

COMP371 COMPUTER GRAPHICS

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

The 3D rendering pipeline (our version for this class)

Information Coding / Computer Graphics, ISY, LiTH. OpenGL! ! where it fits!! what it contains!! how you work with it 11(40)

From system point of view, a graphics application handles the user input, changes the internal state, called the virtual world by modeling or

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

Keyframe Animation. Animation. Computer Animation. Computer Animation. Animation vs Modeling. Animation vs Modeling

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

MODELING AND HIERARCHY

Rendering Smoke & Clouds

- Location: Annenberg Text: Mostly Self-Contained on course Web pages. - Al Barr

animation projects in digital art animation 2009 fabio pellacini 1

Chapter 9- Animation Basics

6.837 Introduction to Computer Graphics Quiz 2 Thursday November 20, :40-4pm One hand-written sheet of notes allowed

Three-Dimensional Computer Animation

Animation. CS 465 Lecture 22

To Do. History of Computer Animation. These Lectures. 2D and 3D Animation. Computer Animation. Foundations of Computer Graphics (Spring 2010)

Lecture 16. Introduction to Game Development IAP 2007 MIT

Game Architecture. 2/19/16: Rasterization

COMPUTER ANIMATION 3 KEYFRAME ANIMATION, RIGGING, SKINNING AND CHARACTER ANIMATION. Rémi Ronfard, Animation, M2R MOSIG

3D GRAPHICS. design. animate. render

Computer Animation. Algorithms and Techniques. z< MORGAN KAUFMANN PUBLISHERS. Rick Parent Ohio State University AN IMPRINT OF ELSEVIER SCIENCE

TSBK 07! Computer Graphics! Ingemar Ragnemalm, ISY

CS 381 Computer Graphics, Fall 2008 Midterm Exam Solutions. The Midterm Exam was given in class on Thursday, October 23, 2008.

Animation. Motion over time

The Graphics Pipeline

History. Early viewers

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

TSBK 07! Computer Graphics! Ingemar Ragnemalm, ISY

Programming with OpenGL Shaders I. Adapted From: Ed Angel Professor of Emeritus of Computer Science University of New Mexico

COMP 175 COMPUTER GRAPHICS. Lecture 10: Animation. COMP 175: Computer Graphics March 12, Erik Anderson 08 Animation

OpenGL refresher. Advanced Computer Graphics 2012

SUMMARY. CS380: Introduction to Computer Graphics Projection Chapter 10. Min H. Kim KAIST School of Computing 18/04/12. Smooth Interpolation

Computer Graphics I Lecture 11

John Hsu Nate Koenig ROSCon 2012

OpenGL/GLUT Intro. Week 1, Fri Jan 12

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

Diploma in Graphics Design. Examinations for / Semester 1

Building scalable 3D applications. Ville Miettinen Hybrid Graphics

Many rendering scenarios, such as battle scenes or urban environments, require rendering of large numbers of autonomous characters.

Game Programming with. presented by Nathan Baur

CS 498 VR. Lecture 20-4/11/18. go.illinois.edu/vrlect20

Game Programming. Bing-Yu Chen National Taiwan University

Rendering Objects. Need to transform all geometry then

Particle systems, collision detection, and ray tracing. Computer Graphics CSE 167 Lecture 17

AMSTERDAM BOSTON HEIDELBERG LONDON NEW YORK OXFORD PARIS SAN DIEGO SAN FRANCISCO SINGAPORE SYDNEY TOKYO F ^ k.^

Programmable GPUs. Real Time Graphics 11/13/2013. Nalu 2004 (NVIDIA Corporation) GeForce 6. Virtua Fighter 1995 (SEGA Corporation) NV1

Computer Animation Fundamentals. Animation Methods Keyframing Interpolation Kinematics Inverse Kinematics

OPENGL RENDERING PIPELINE

Programming with OpenGL Shaders I. Adapted From: Ed Angel Professor of Emeritus of Computer Science University of New Mexico

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

CMSC427 Advanced shading getting global illumination by local methods. Credit: slides Prof. Zwicker

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

Attention to Detail! Creating Next Generation Content For Radeon X1800 and beyond

CHAPTER 1 Graphics Systems and Models 3

16 - Other Topics. The Stencil Buffer. Erosion. Fragment Discarding. Multi-Texturing + +

Topics in Computer Animation

Graphics Programming. Computer Graphics, VT 2016 Lecture 2, Chapter 2. Fredrik Nysjö Centre for Image analysis Uppsala University

EF432. Introduction to spagetti and meatballs

Character Animation 1

CS2401 COMPUTER GRAPHICS ANNA UNIV QUESTION BANK

Overview. Animation is a big topic We will concentrate on character animation as is used in many games today. humans, animals, monsters, robots, etc.

Graphics and Interaction Rendering pipeline & object modelling

Sliding and Rotating Objects. Appendix 1: Author s Notes

OUTLINE. Learn the basic design of a graphics system Introduce pipeline architecture Examine software components for a graphics system

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

Enhancing Traditional Rasterization Graphics with Ray Tracing. October 2015

animation computer graphics animation 2009 fabio pellacini 1

Efficient and Scalable Shading for Many Lights

Pipeline Operations. CS 4620 Lecture 14

Transcription:

33(70) Information Coding / Computer Graphics, ISY, LiTH Animation Essentially a question of flipping between many still images, fast enough 33(70)

Animation as a topic Page flipping, double-buffering Sprite animation Movement and posing Collision detection and handling Deformations 34(70)34(70)

Double buffering Flicker-free animation 35(70)35(70)

The double buffering problem When animating a scene with many objects in real time, it is not just a question of showing images: Erase the entire scene Draw each visible object in new positions This procedure may be visible if done on-screen 36(70)36(70)

Single buffered animation Flicker Screen update beam If the beam passes over an area while it is erased, flicker will occur. 37(70)37(70)

Solutions 1) Don t erase-and-redraw near the update beam Unreliable. Doesn t work on all screens. 2) Double buffering. Needs more memory. Otherwise easy to do and reliable. 38(70)38(70)

Double buffering VRAM VRAM VRAM Buffer 1 Buffer 2 Buffer 1 Buffer 2 Copy Choose buffer Fixed output image buffer Animation with double output buffers Animation with a single output buffer 39(70)39(70)

Double buffered animation Tearing Screen update beam Occurs if buffers switch while the screen is being redrawn. Synch with vsync to avoid. 40(70)40(70)

Built-in VBL sync (vsync) Modern systems have VBL sync built-in - even mandatory double buffering. You may need to turn vsync off to test maximum frame rate. 41(70)41(70)

Double buffering in OpenGL Double buffer Pass GLUT_DOUBLE to glutinitdisplaymode glutswapbuffers(); Repeated redraw glutrepeatingtimer() or timer callback with glutpostredisplay() Update position variables 42(70)42(70)

Sprite animation 2D animation based on 2D images. Extremely common in games (Often indie games and/or mobile games.) 43(70)43(70)

Sprites in OpenGL Use textured polygons with transparency (Like billboards but without 3D.) Special blitter calls existed in GL2, but they were not guaranteed to be fast 44(70)44(70)

Pseudo-3D effects Scaled sprites on background with perspective: Depth cue by size Side-scrolling with parallax scroll: Depth cue by movement Depth due by shadows Distance between object and shadow gives important information 45(70)45(70)

Depth from shadows 46(70)46(70)

Depth from size 47(70)47(70)

Depth from movement Parallax scroll Classic example: Moon Patrol 48(70)48(70)

Pseudo-3D effects vs 3D Depth from size = perspective projection Parallax scroll: Comes for free to some extent, but can be emphasized with cameras observing the viewer Depth from shadows: That is why shadows are important in 3D It is needed for full 3D experience. 49(70)49(70)

Animation techniques for moving objects Procedural animation Physics-based animation Pre-programmed animation paths 50(70)50(70)

Animation paths Use Catmull-Rom splines Predictable, smooth, continuous 51(70)51(70)

Character animation Pre-defined poses Key-frame animation Forward kinematics Inverse kinematics Physics based animation Motion capture 52(70)52(70)

Key-frame animation Pre-rendered animations Key-frames are designed at suitable intervals Frames between keyframes are interpolated (morphed) Very common method for real-time animation 53(70)53(70)

Kinematics Kinematics = movement without forces Forward kinematics: Specify poses by specifying rotation of joints. Easy to implement, but specifying poses is much trial-anderror. Inverse kinematics: Goal-driven posing. Specify where some part should go (i.e. a hand) and calculate necessary rotations 54(70)54(70)

Motion capture Extremely common in movies Record by natural visuals only Tracking markers Active sensors on the body Perfect for pre-generated animations. 55(70)55(70)

Face animation Hard problem - we are very sensitive to errors Animate by action units (muscle based) or face animation parameters (extreme detail) FAPs part of the MPEG-4 standard. The Candide model 56(70)56(70)

Some advanced animation topics Bones and skinning systems Deformations Physics-based animation Quaternions, SLERP Mainly subjects for later courses 57(70)57(70)

Particle systems Spectacular effects with little effort Many small moving objects. Explosions Water Fire Snow Rain 58(70)58(70)

Particle system Example: Water No randomness - bad 59(70)59(70)

Particle system Example: Water 60(70)60(70)

Particle system Initial position Initial speed (usually with some randomness)) Movement (usually independent, physically realistic) Termination rule (e.g. hits ground, fades away after some time...) 61(70)61(70)

Particle system Movement according to fundamental physics: acceleration = gravity + forces/mass speed = speed + acceleration position = position + speed Euler integration 62(70)62(70)

Particle system on GPU CPU-driven particle systems OK up to a certain size Data transfer (new positions) of all particles can be a bottleneck Can the whole particle system be computed on the GPU? 63(70)63(70)

Texture based particle systems Use textures to store x, y, z, dx, dy, dz Store as color components (r, g, b) Needs advanced texturing features (render to texture, floating-point buffers) Particles as billboards. Each polygon must identify its particle data. 64(70)64(70)

Separate compute kernels for particle systems CUDA, OpenCL, Compute shaders Free choice of data formats Less integration with the OpenGL pipeline 65(70)65(70)

Drawing particle systems Large number of very simple models (billboards) Modest demands on GPU, but very large number of function calls Solution: Instancing 66(70)66(70)

Instancing Draw a large number of the same model Each instance has an index, the instance number. gldrawarraysinstanced(gl_triangles, 0, 3, 10); draws a triangle 10 times gl_instanceid tells the shader which instance we have. Use for affecting position. 67(70)67(70)

Billboard instancing demo One single call to gldrawarraysinstanced Position trivially affected by gl_instance ID #version 150 in vec3 in_position; uniform mat4 mymatrix; uniform float angle; uniform float slope; out vec2 texcoord; void main(void) { mat4 r; float a = angle + gl_instanceid * 0.5; float rr = 1.0 - slope * gl_instanceid * 0.01; r[0] = rr*vec4(cos(a), -sin(a), 0, 0); r[1] = rr*vec4(sin(a), cos(a), 0, 0); r[2] = vec4(0, 0, 1, 0); r[3] = vec4(0, 0, 0, 1); texcoord.s = in_position.x+0.5; texcoord.t = in_position.y+0.5; gl_position = r * mymatrix * vec4(in_position, 1.0); } 68(70)68(70)

Instancing complex models Less significant; A more complex model puts enough load on the system to hide the impact of instancing. 69(70)69(70)

Basic: Start on CPU Advanced: Go for GPU acceleration Performance is important, but GPU based particle systems are beyond basic course goals. 70(70)70(70)