Mark Nelson Graphics hardware & Game worlds Fall 2013

Slides:



Advertisements
Similar presentations
Using 2D sprite with OpenGL 2003 team Koguyue. Overview Motivation and basic concepts Advantages with using OpenGL Basic requirements of implementation.
Advertisements

Multi-monitor Game Development Thomas Fortier AMD Graphics Developer Relations
COMPUTER GRAPHICS CS 482 – FALL 2014 NOVEMBER 10, 2014 GRAPHICS HARDWARE GRAPHICS PROCESSING UNITS PARALLELISM.
Graphics Pipeline.
CAP4730: Computational Structures in Computer Graphics Visible Surface Determination.
Computer Graphics Visible Surface Determination. Goal of Visible Surface Determination To draw only the surfaces (triangles) that are visible, given a.
Mark Nelson Rendering algorithms Fall 2013
Week 14 - Monday.  What did we talk about last time?  Bounding volume/bounding volume intersections.
Damon Rocco.  Tessellation: The filling of a plane with polygons such that there is no overlap or gap.  In computer graphics objects are rendered as.
Rasterization and Ray Tracing in Real-Time Applications (Games) Andrew Graff.
Display of Objects on Screen. COUNTERS b A horizontal counter represents the horizontal position of the monitor’s electron beam. b A vertical counter.
1 CSCE 441: Computer Graphics Hidden Surface Removal (Cont.) Jinxiang Chai.
Vertical Retrace Interval An introduction to VGA techniques for smooth graphics animation.
Graphics Systems I-Chen Lin’s CG slides, Doug James’s CG slides Angel, Interactive Computer Graphics, Chap 1 Introduction to Graphics Pipeline.
The Graphics Pipeline CS2150 Anthony Jones. Introduction What is this lecture about? – The graphics pipeline as a whole – With examples from the video.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Models and Architectures Ed Angel Professor of Computer Science, Electrical and Computer.
Computer Graphics Hardware and Software Lecture Notes, CEng 477.
AGD: 5. Game Arch.1 Objective o to discuss some of the main game architecture elements, rendering, and the game loop Animation and Games Development.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Beyond Meshes Spring 2012.
Week 1 - Friday.  What did we talk about last time?  C#  SharpDX.
2 What is pyGame? A set of Python modules to make it easier to write games. –home page: –documentation:
1 Chapter 1: Graphics Systems and Models. 2 Applications of C. G. – 1/4 Display of information Maps GIS (geographic information system) CT (computer tomography)
Antigone Engine Kevin Kassing – Period
CSE 381 – Advanced Game Programming Basic 3D Graphics
Mark Nelson What are game engines? Fall 2013
Lecture No. 3.  Screen resolution  Color  Blank space between the pixels  Intentional image degradation  Brightness  Contrast  Refresh rate  Sensitivity.
GAME:IT Junior Learning Game Maker: The Move Tab.
Week 2 - Wednesday CS361.
09/09/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Event management Lag Group assignment has happened, like it or not.
Art 315 Lecture 6 Dr. J. Parker. Variables Variables are one of a few key concepts in programming that must be understood. Many engineering/cs students.
CS 450: COMPUTER GRAPHICS REVIEW: INTRODUCTION TO COMPUTER GRAPHICS – PART 2 SPRING 2015 DR. MICHAEL J. REALE.
CSC 461: Lecture 3 1 CSC461 Lecture 3: Models and Architectures  Objectives –Learn the basic design of a graphics system –Introduce pipeline architecture.
Overview of Graphics Systems. Cathode-ray Tube (CRT) - colors are represented using Red, Green, and Blue components - the CRT has a mechanism for.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Computer Graphics Week2 –Creating a Picture. Steps for creating a picture Creating a model Perform necessary transformation Lighting and rendering the.
1Computer Graphics Lecture 4 - Models and Architectures John Shearer Culture Lab – space 2
Hidden Surface Removal 1.  Suppose that we have the polyhedron which has 3 totally visible surfaces, 4 totally invisible/hidden surfaces, and 1 partially.
INT 840E Computer graphics Introduction & Graphic’s Architecture.
Game Maker Terminology
Maths & Technologies for Games DirectX 11 – New Features Tessellation & Displacement Mapping CO3303 Week 19.
Ahmed Saker Indie Game Developer
Games Development 2 Entity Update & Rendering CO3301 Week 2, Part 1.
Mark Nelson 3d projections Fall 2013
CSCE 552 Spring D Models By Jijun Tang. Triangles Fundamental primitive of pipelines  Everything else constructed from them  (except lines and.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
What are Computer Graphics Basically anything that is on you Monitor – This includes the text that you will see Text isn’t Advanced Graphics But…. Understanding.
1 CSCE 441: Computer Graphics Hidden Surface Removal Jinxiang Chai.
Advanced Games Development Game Physics CO2301 Games Development 1 Week 19.
Graphics, Modeling, and Textures Computer Game Design and Development.
Chapter 1 Graphics Systems and Models Models and Architectures.
OUTPUT PRIMITIVES A.Aruna/Faculty of Information technology/SNSCE13/19/2016.
1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Models and Architectures 靜宜大學 資訊工程系 蔡奇偉 副教授 2012.
App Inventor Chapter 17 – Creating Animated Apps.
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
COMPUTER GRAPHICS CHAPTER 38 CS 482 – Fall 2017 GRAPHICS HARDWARE
- Introduction - Graphics Pipeline
Scene Manager Creates and places movable objects like lights and cameras so as to access them efficiently, e.g. for rendering. Loads and assembles world.
Week 2 - Monday CS361.
Background Shapes & Collision Resolution (Top-down and Side-scrolling)
Example: Card Game Create a class called “Card”
Models and Architectures
Models and Architectures
CSCE 441: Computer Graphics Hidden Surface Removal
Models and Architectures
Introduction to Computer Graphics with WebGL
Graphics, Modeling, and Textures
UMBC Graphics for Games
Models and Architectures
Models and Architectures
Presentation transcript:

Mark Nelson Graphics hardware & Game worlds Fall

Exercise from last week  Choose a game  Does it generalize into a game engine?

Engine levels  Hardware  Graphics primitives  In-memory representations  In-engine representations  Gameplay

In the beginning

Oscilloscope X-Y mode  Two wire inputs  Phosphor beam points at the (x,y) given by their voltages  Vary voltages to move beam  Fast-moving beam simulates image, due to phosphor decay

Bouncing oscilloscope ball

Tennis for Two (1958)

Oscilloscope properties  No memory:  Points start to fade nearly instantly  Write-only  Multiple objects mean flicker  Brilliant, smooth outlines, but no sprites

Programming an oscilloscope game  Programming is strange  Continuous time: no frames, time advances continually  Must ”know” where everything is  Lag in drawing borks the display

Pixel grid with a framebuffer  The ”standard” 2d graphics interface  int pixels[640][480];  pixel[50][200] = 10;  Graphics driver redraws the framebuffer to the screen N times per second

Framebuffer plusses  Memory:  Pixels stay when you set them  Pixel values can be read  Discrete time: draw image, then image is displayed  Complex shapes & sprites are easy

Framebuffer drawbacks?  Can you think of any?

Erasing the old image  If the ball moves, how do we get rid of its old position?  Oscilloscope images decay for us, so just wait  With the framebuffer, we have to handle this

One way  Redraw everything (perhaps w/ double-buffering) for (int x = 0; x < WIDTH; x++) { for (int y = 0; y < HEIGHT; y++) { pixelBuf[x][y] = 0; for (int i = 0; i < objects.size(); i++) { objects[i].draw(pixelBuf); drawBuffer(pixelBuf)

Redrawing everything  What if the framebuffer is on the graphics card?  What if our memory bandwidth to the card is low?  Don’t want to re-send all data, just what changed

Blitting  Moving sprites have a mask  Draw by combining with background  Movement involves  Undraw  Redraw somewhere else  Also: overlaps, etc.

Hardware sprite support  Stick sprites in some registers, let card handle blitting  Higher-level API:  Move sprite to (x,y)  Move sprite 5px left  Set sprite to be moving at px-left-per-frame velocity

Hardware sprite pros  No manual blitting  Maybe faster  Maybe sprites can have extra features  Higher-res  Built-in collision detection

Hardware sprite cons  Any downsides?

Hardware sprite cons  Assumes a particular way of using the framebuffer  Number of sprites  Size of sprites  Becomes a strange low-level graphics device if assumptions not met

Example: Atari 2600  Framebuffer: but only enough for half of one low-res line  2x higher-res hardware sprites, plus 2x ’missile’ and a ’ball’  Draws one TV scanline at a time  Pulls out of the registers whatever is in them when the electron beam is ready for them

Racing the beam

Programming the Atari 2600  Background will be vertical lines unless you do something  Change the values as lines are being drawn  Normally, exactly two sprites, two missiles, and a ball

Combat

Programming the Atari 2600 more  Change registers on the fly  Count cycles and change background in mid-line  Recycle sprite registers between lines  Flicker between sprites

Pac-Man

What about 3d?

Doom

Doom: 3d?  3d room interiors  2d sprites  8 or 16 angles  2d in the vertical plane, parallel to the screen  2d entity positions  2d in the horizontal plane  2d skyboxes

Doom: why sort-of 3d?  No moving 3d  Pre-render lighting/textures/collision boxes  2d collision detection  No high-poly models  One result:  2d level design / movement

Static v. dynamic  Static meshes  Pre-render effects  No checks for updates  Precomputed data structures  Downsides  Deformable terrain?  Consistent lighting?

Completely different approach: voxels  3d volumetric-pixel grid  int voxel[1000][1000][1000];  voxel[50][0][22] = ROCK;  Render visible surfaces

Minecraft’s use of voxels  One-to-one mapping between voxels and game-world  World is made of building blocks  The blocks are voxels  Convert to renderable scene when ”nearby”

Minecraft

Minecraft pros/cons?  Compared to a poly-based ”regular” 3d engine  [discuss]

Design considerations of a 3d pipeline  What’s retained on the GPU?  What kind of model, camera, T&L pipeline?  What’s built in v. programmable?  Previous trend was towards specialized hardware support for a fixed pipeline  Current trend is towards program-everything, but on the GPU

Built-in hardware features  Like engine features, make some things easier, but can be too opinionated/constraining  Different in that it’s not just a design/architecture consideration. Choice also needs to align with technical constraints.

First project  A 2d platform-game engine  First steps:  Set up a 2d drawing context, (e.g. SDL with SDL_Surface )  Draw background  Blit & move sprites  Begin thinking about data structures