Demoscene and Maths. Presentation by Konstantinos Pataridis aka Navis/ASD University of Oxford August 2006

Similar documents
CS451Real-time Rendering Pipeline


PHYSICALLY BASED ANIMATION

TSBK03 Screen-Space Ambient Occlusion

Overview: Ray Tracing & The Perspective Projection Pipeline

Adarsh Krishnamurthy (cs184-bb) Bela Stepanova (cs184-bs)

Water. Notes. Free surface. Boundary conditions. This week: extend our 3D flow solver to full 3D water We need to add two things:

CMSC 425: Lecture 10 Skeletal Animation and Skinning

Texture-Mapping Tricks. How Bad Does it Look? We've Seen this Sort of Thing Before. Sampling Texture Maps

(Realistic) Modelisation of Water Waves, some applications to to visualization of liquid surfaces.

Shape of Things to Come: Next-Gen Physics Deep Dive

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

Maths at the Movies. Chris Budd

Lab 9 - Metal and Glass

CMSC427 Final Practice v2 Fall 2017

Topics and things to know about them:

COMP 175 COMPUTER GRAPHICS. Ray Casting. COMP 175: Computer Graphics April 26, Erik Anderson 09 Ray Casting

Introduction to Visualization and Computer Graphics

DH2323 DGI13. Lab 2 Raytracing

Rendering Smoke & Clouds

Problem Set 4 Part 1 CMSC 427 Distributed: Thursday, November 1, 2007 Due: Tuesday, November 20, 2007

Normal Maps and Cube Maps. What are they and what do they mean?

Real Time Rendering of Complex Height Maps Walking an infinite realistic landscape By: Jeffrey Riaboy Written 9/7/03

CS 354R: Computer Game Technology

Approximating Refraction Kenneth Hurley Please send me comments/questions/suggestions

Chapter 12- NURBS & Meta Shape Basics

Surface Tension. Liquid Effects in The Last of Us. Eben Cook Lead Visual Effects Artist, Naughty Dog Inc. Wednesday, March 19, 14

Question 2: Linear algebra and transformations matrices rotation vectors linear transformation T=U*D*VT

Review. Stephen J. Guy

Applications of Explicit Early-Z Culling

Computer Graphics Disciplines. Grading. Textbooks. Course Overview. Assignment Policies. Computer Graphics Goals I

Paint by Numbers and Comprehensible Rendering of 3D Shapes

+ = To Do. Adding Visual Detail. Texture Mapping. Parameterization. Option: Varieties of projections. Foundations of Computer Graphics (Fall 2012)

Abstract. Introduction. Kevin Todisco

CS 465 Program 5: Ray II

Realistic Animation of Fluids

CS 184: Assignment 4 Simple Raytracer

Digital Sound Ming C. Lin & Zhimin Ren

Navier-Stokes & Flow Simulation

Homework #2. Hidden Surfaces, Projections, Shading and Texture, Ray Tracing, and Parametric Curves

Introduction Ray tracing basics Advanced topics (shading) Advanced topics (geometry) Graphics 2010/2011, 4th quarter. Lecture 11: Ray tracing

Sparkling Effect. February 2007 WP _v01

CS Simple Raytracer for students new to Rendering

CS 4620 Program 4: Ray II

I have a meeting with Peter Lee and Bob Cosgrove on Wednesday to discuss the future of the cluster. Computer Graphics

1 Overview. EPFL 14 th Apr, /6. Michaël Defferrard Pierre Fechting Vu Hiep Doan

CHAPTER 1 Graphics Systems and Models 3

CS354 Computer Graphics Ray Tracing. Qixing Huang Januray 24th 2017

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

Dynamical Simulation 1: Particle Systems and ODEs

CS 184: Assignment 2 Scene Viewer

Complex Features on a Surface. CITS4241 Visualisation Lectures 22 & 23. Texture mapping techniques. Texture mapping techniques

CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY CS2401 COMPUTER GRAPHICS QUESTION BANK

Navier-Stokes & Flow Simulation

Computer Graphics CS 543 Lecture 13a Curves, Tesselation/Geometry Shaders & Level of Detail

More Animation Techniques

Today. Rendering pipeline. Rendering pipeline. Object vs. Image order. Rendering engine Rendering engine (jtrt) Computergrafik. Rendering pipeline

Chapter 12 Notes: Optics

The Rasterization Pipeline

Advanced Texture-Mapping Curves and Curved Surfaces. Pre-Lecture Business. Texture Modes. Texture Modes. Review quiz

Clipping & Culling. Lecture 11 Spring Trivial Rejection Outcode Clipping Plane-at-a-time Clipping Backface Culling

CS GPU and GPGPU Programming Lecture 2: Introduction; GPU Architecture 1. Markus Hadwiger, KAUST

Full Screen Layout. Main Menu Property-specific Options. Object Tools ( t ) Outliner. Object Properties ( n ) Properties Buttons

Real-Time Volumetric Smoke using D3D10. Sarah Tariq and Ignacio Llamas NVIDIA Developer Technology

Computer Graphics. - Texturing Methods -

High Performance Visibility Testing with Screen Segmentation

Computer Graphics Ray Casting. Matthias Teschner

Complex Shading Algorithms

CSE 167: Introduction to Computer Graphics Lecture #5: Rasterization. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2015

FLUENT Secondary flow in a teacup Author: John M. Cimbala, Penn State University Latest revision: 26 January 2016

Shape Representation Basic problem We make pictures of things How do we describe those things? Many of those things are shapes Other things include

CS 563 Advanced Topics in Computer Graphics Camera Models. by Kevin Kardian

Navier-Stokes & Flow Simulation

Visualizer An implicit surface rendering application

Voxels. Tech Team - Johnny Mercado, Michael Matonis, Glen Giffey, John Jackson

2.7 Cloth Animation. Jacobs University Visualization and Computer Graphics Lab : Advanced Graphics - Chapter 2 123

Interpolation and Basis Fns

ULTIMATE IRAY SKIN MANAGER

Orthogonal Projection Matrices. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

Chapter 4. Chapter 4. Computer Graphics 2006/2007 Chapter 4. Introduction to 3D 1

Mathematical Tools in Computer Graphics with C# Implementations Table of Contents

Chapter 13 - Modifiers

Let s start with occluding contours (or interior and exterior silhouettes), and look at image-space algorithms. A very simple technique is to render

Introduction to 3D Graphics

+ = To Do. Texture Mapping. Adding Visual Detail. Parameterization. Option: Varieties of projections. Computer Graphics. geometry

6.837 Introduction to Computer Graphics Assignment 5: OpenGL and Solid Textures Due Wednesday October 22, 2003 at 11:59pm

Homework #2. Shading, Ray Tracing, and Texture Mapping

CSCI 4972/6963 Advanced Computer Graphics Quiz 2 Tuesday April 17, 2007 noon-1:30pm

Interactive Computer Graphics A TOP-DOWN APPROACH WITH SHADER-BASED OPENGL

9. Three Dimensional Object Representations

Computer Graphics Fundamentals. Jon Macey

Computer Graphics Introduction. Taku Komura

Rendering and Radiosity. Introduction to Design Media Lecture 4 John Lee

TDA362/DIT223 Computer Graphics EXAM (Same exam for both CTH- and GU students)

galileo Design Document Solomon Boulos

Introduction. Chapter Computer Graphics

Spring 2009 Prof. Hyesoon Kim

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

16.410/413 Principles of Autonomy and Decision Making

Introduction to Geometry. Computer Graphics CMU /15-662

Transcription:

Demoscene and Maths Presentation by Konstantinos Pataridis aka Navis/ASD University of Oxford August 2006

Demos are a challenge: There is no strict definition of a demo, in the broad sense it is a blend of real-time graphics and music. Demos are the result of a collaboration: A small team of people gets together and produces the visual effects (by programming) and the music that goes with the visuals. Usually 3-8 minutes of content - just like a video-clip. Demos are then presented at parties, and compete with each other based on artistic and technical merit.

What does a demo look like? To get the feeling of a demo, we present 2 of our demos with my group ASD: Planet Risk (2004) and Iconoclast (2005) Some of the effects will be analyzed later in more detail.

How do you start? Months of experimentation. First build a simple demo-engine. Write dozen of effects - best ones are kept for the end demo. Same for the music : Make small tracks, select a few and glue them at the end. Put everything together and optimize - make it smooth and fast Frame-rate is important, too low and the movements become jerky.

And what about the tools involved? Demos are usually made by programming in C/C++ and another language that gives you some basic computer graphics functionality. Almost everything is in the form of a 'black box' - a unit that has an input and an output. Example : To draw a triangle, you define the vertices and call the execution of the routine, which draws the triangle. Everything is serialized, and from the humble triangle one can build the most complicated structures!

At a high level, we need to take care of the following problem: Input: A scene of objects (static or animating) that are described in a 3D space A Camera through which we look at the scene Output: A 2D image that is displayed on our monitor

Computer graphics crash course Computer graphics are the essence of demos. They are used to synthetically generate images. Demos use real-time 3D rendering. Real-time : Everything is generated on the fly, unlike an animation like, for example, Toy-Story. Everything that is rendered on screen is made out of triangles. Every triangle has 3 vertices. Every vertex is defined by a point in 3D space.

Computer graphics crash course All vertices of all triangles are transformed according to properties of the camera. The transformed vertices are then projected on a 2D image - our monitor. The operation is a simple vector to matrix multiplication, and is automated: In reality, we only need to define where our camera is, and where it looks at - all triangles are then properly aligned and projected.

Computer graphics crash course Finally, we need to 'fill' the triangles with a color or a texture. There are different 'shading' models for every occasion. Different shading models can make the model look like it is made out of wood, or gold or even glass. We will look at glass emulation in more detail later on...

Computer graphics crash course 3 vertices Triangle Triangle with shading

Building a scene We build a scene in a demo, by adding together different visual elements Elements can be either static/animating models, or particle systems We move the camera around the scene to reveal more detail Eventually we 'spice-up' things by adding postprocessing effects, for example noise to emulate an 'oldfilm' look

Particle systems? Attempt to simulate fuzzy phenomena such as sparks, falling leaves, clouds and snow Each 'particle' is a dynamic entity and can have a unique position and behavior. It is usually rendered as a quad (two triangles) with a texture. However, a particle system usually needs hundreds to thousands of particles to look realistic!

Particle system example

Summary Demos look complex but they are not. They are made out of a series of building blocks. Divide and conquer : Build your demo one step at a time. The ideas are usually straightforward, and the maths involved very simple. To demonstrate, we will look at 3 cases, from a highlevel perspective, without any implementation details :

A Particle system for the blood cells in Planet Risk The glass box in Planet Risk The ribbons around an object in Iconoclast

Blood cells particle system Hypothesis : the cell particles should move from one end of the 'tube' to the other in a 'organic' fashion Organic? - motion not strictly linear Also : What happens when they reach the end of the tube? They must appear again at the other end!

Blood cells particle system We assign a position vector for a number of particles. Original position should be inside a cylinder. So : ϑ=2π*rand0to1 Rad=rand0to1*Radius P=(Rad*sin(ϑ), Rad*cos(ϑ), rand0to1*length) Then assign a direction for each particle: D=(0, 0, rand0to1+0.1)

Blood cells particle system At each iteration increase P by D: P =P+D Add an organic parameter. A 'swirling' motion around the length : P =P+D+ (ϕ*sin(time+rand1), θ*sin(time+rand2),ρ*sin(time+rand3)) Where ϕ, θ, ρ small random values, and rand1,2,3 a random phase difference

Blood cells particle system We add random rotations of the particle cells around their origin, in a similar fashion. The camera follows a path which is a combination of linear motion in Z and sin/cos in X and Y

Blood cells particle system What happens at the end points? Position of particle has to be reset, so : P =P-(0, 0, Length) We add a scaling factor so that the particle just doesn't disappear and pop-up, but rather gets smaller as it gets to the beginning and end of the run: Scale(P)=max(0,min(1,2*sin(π*(P.z/Length))))

Blood cells particle system The particle system is now ready to render using triangles. We spice things up by render with a nonphoto-realistic technique, and some token postprocessing filter (bloom effect and 16:9 pseudo ratio).

The glass box A very different effect. We want to emulate a rough surface that looks like glass and animate that surface in organic fashion. Twofold problem. First problem : Glass effect. Recall refraction : For each point on the surface of cube we define a unique normal vector that follows the rough surface.

The glass box refraction Any incoming ray is 'bent' fractionally by this normal: I =I+N*ϑ, with ϑ very small This is NOT proper refraction, but end result looks very close to 'glass'. It is a very simple formula without expensive Fresnel operations. Remember 'If it looks correct it is correct ' old computer graphics saying. We add : 'And is also fast enough'.

The animation of glass texture Static 'glass' texture looks nice. We can improve : Emulate an organic swirling effect. Example methods for different detail levels and speed: Explicit: Add functions of phased sin/cos and animate in time. Fast but looks very synthetic Perlin noise : Spectral synthesis of multiple layers of noise textures. Tries to imitate the pseudo-randomness of nature. Natural looking but not as fast. Emulation of fluid dynamics using Navier-Stokes equations or wave simulation using a differential equation. Still not very fast but give best results.

The animation of glass texture We use wave simulation: In each iteration, our 2D scalar Map[x,y] is perturbed at random points. The spreading of the waves is emulated through the discrete version of the differential equation for waves: Map [x,y]=1/2* (Map[x+1,y]+Map[x-1,y]+Map[x,y-1]+Map[x,y+1])-Map[x,y] And the damping factor, so that waves are weakened with time: Map [x,y]=map [x,y]*φ, φ<1

Ribbons around an object This is not exactly an effect, but a pre-processing step to create an effect. Problem : Given a 3D model, how can we find the paths of seemingly random ribbons that unfold over the model?

Solution : Pick a random vertex on the model with position P. Define a random direction vector D. Add P+D and find the vertex of the model that is closer to the object. D can change as a sin/cos function of time (just like the position of particles in previous example). P = new vertex. Ribbons around an object Store all P in a sequence and repeat until we are outside of the model. The sequence of Ps can be rendered using lines, splines or particles.

Ribbons around an object There is an extra problem: Remember that a 3D model is made out of triangles. In some cases, the model can be very sparse. As such, the ribbons propagate in an abrupt, zigzag manner. We need to populate the model with new vertices that lie on the triangles, so as to increase density. Trivial : For each triangle, just add random vertices that between the 3 original vertices of the triangle (triangle / vertex test)

Summary In demos, apparently irrelevant solutions are used to improve the quality of the visuals. The maths used are very simple as long as they are modular: Complicated tasks must be separated and treated in different steps Other effects borrow heavily from the fields of algebra, analytic geometry, fractal geometry, and differential equations.

Summary The secret is probably to know what sort of solution would give a result that 'looks' about right. And is fast enough. All in all, computer graphics in demos require experimentation and imagination! The ability to think out of the box.

Discussion / Questions