02 | What DirectX Can Do and Creating the Main Game Loop

Slides:



Advertisements
Similar presentations
Categories of I/O Devices
Advertisements

COMPUTER GRAPHICS CS 482 – FALL 2014 NOVEMBER 10, 2014 GRAPHICS HARDWARE GRAPHICS PROCESSING UNITS PARALLELISM.
WHAT IS AN OPERATING SYSTEM? An interface between users and hardware - an environment "architecture ” Allows convenient usage; hides the tedious stuff.
Artificial Intelligence in Game Design Hierarchical Finite State Machines.
1 CS 106, Winter 2009 Class 4, Section 4 Slides by: Dr. Cynthia A. Brown, Instructor section 4: Dr. Herbert G. Mayer,
Figure 2.8 Compiler phases Compiling. Figure 2.9 Object module Linking.
1: Operating Systems Overview
Advanced OS Chapter 3p2 Sections 3.4 / 3.5. Interrupts These enable software to respond to signals from hardware. The set of instructions to be executed.
Chapter 1 and 2 Computer System and Operating System Overview
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.
CSE 381 – Advanced Game Programming 3D Game Architecture.
LOGO OPERATING SYSTEM Dalia AL-Dabbagh
Operating System Review September 10, 2012Introduction to Computer Security ©2004 Matt Bishop Slide #1-1.
Translate the following message:
The process concept (section 3.1, 3.3 and demos)  Process: An entity capable of requesting and using computer resources (memory, CPU cycles, files, etc).
Operating Systems ECE344 Ashvin Goel ECE University of Toronto OS-Related Hardware.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
“The perfect project plan is possible if one first documents a list of all the unknowns.” Bill Langley.
1: Operating Systems Overview 1 Jerry Breecher Fall, 2004 CLARK UNIVERSITY CS215 OPERATING SYSTEMS OVERVIEW.
CSE 381 – Advanced Game Programming GLSL. Rendering Revisited.
Computer Graphics 3 Lecture 6: Other Hardware-Based Extensions Benjamin Mora 1 University of Wales Swansea Dr. Benjamin Mora.
UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS Game program main loop.
Introduction to Game Programming Pertemuan 11 Matakuliah: T0944-Game Design and Programming Tahun: 2010.
Advanced Operating Systems CS6025 Spring 2016 Processes and Threads (Chapter 2)
Siggraph 2009 RenderAnts: Interactive REYES Rendering on GPUs Kun Zhou Qiming Hou Zhong Ren Minmin Gong Xin Sun Baining Guo JAEHYUN CHO.
Our Graphics Environment Landscape Rendering. Hardware  CPU  Modern CPUs are multicore processors  User programs can run at the same time as other.
Introduction to Operating Systems Concepts
Unit 2 Technology Systems
Computer Organization
GPU Architecture and Its Application
Homework Reading Machine Projects Labs
Operating System & Application Software
Running a Forms Developer Application
Interrupt Processing Sequence
COMPUTER GRAPHICS CHAPTER 38 CS 482 – Fall 2017 GRAPHICS HARDWARE
- Introduction - Graphics Pipeline
Processes and threads.
Porting your Unity Game to the Windows Store Jump Start
Topics Introduction Hardware and Software How Computers Store Data
Lesson Objectives Aims Key Words Interrupt, Buffer, Priority, Stack
Introduction to Visual Basic 2008 Programming
Chapter 5: Using System Software
Stored program concept
OPERATING SYSTEMS CS3502 Fall 2017
Build /24/2018 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Ogre Overview.
TYPES AND COMPONENTS OF COMPUTER SYSTEM
Computer System Overview
Introduction to Operating System (OS)
Drill Translate the following message:
Managed DirectX Joe Gavin.
TerraForm3D Plasma Works 3D Engine & USGS Terrain Modeler
IOS App Development.
Programmable Logic Controllers (PLCs) An Overview.
Multicultural Social Community Development Institute ( MSCDI)
System Structure B. Ramamurthy.
Engineering 1020 Introduction to Programming
Computer Animation System Overview
Topics Introduction Hardware and Software How Computers Store Data
Operating Systems.
Outline Module 1 and 2 dealt with processes, scheduling and synchronization Next two modules will deal with memory and storage Processes require data to.
Threads Chapter 4.
PROCESSES & THREADS ADINA-CLAUDIA STOICA.
CSE 451: Operating Systems Autumn 2001 Lecture 2 Architectural Support for Operating Systems Brian Bershad 310 Sieg Hall 1.
Chapter 3: Processes.
RADEON™ 9700 Architecture and 3D Performance
Software - Operating Systems
CIS 441/541: Introduction to Computer Graphics Lecture 15: shaders
03 | Creating, Texturing and Moving Objects
05 | Capturing User Input Michael “Mickey” MacDonald | Indie Game Developer Bryan Griffiths | Software Engineer/Game Developer.
Presentation transcript:

02 | What DirectX Can Do and Creating the Main Game Loop Michael “Mickey” MacDonald | Indie Game Developer Bryan Griffiths | Software Engineer/Game Developer

Module Overview Capabilities of DirectX 11 What’s New to DirectX 11 The IFrameworkView and Your App The Basic Game Loop The Update Stage The Rendering Stage

Capabilities of DirectX 11 Full featured set of APIs enabling you to create high-end 2D and 3D graphics applications/games. Direct 2D/Direct 3D: Handles graphics. DirectWrite: Handles text rendering features. DirectXMath: Provides handy functions for doing the math you love… ;) XInput: Replaces the old DirectInput API and helps you to provide console controller support. XAudio2: Replaces Direct Audio, allowing you to create a high performance audio engine while improving performance at the same time.

What’s New to DirectX 11 New shader pipeline stages: Hull Shader Tessellator Domain Shader Allows for seamless LOD through dynamic tessellation.

What’s New to DirectX 11 Loosely coupled secondary pipeline: Use of a compute shader allows the GPU to be used as a generic grid of data-parallel processors. It has explicit access to your GPUs faster memory banks. It can also do scattered reads and writes to memory. Allows engine developers to move CPU intensive operations to the GPU as a form of load balancing.

The IFrameworkView and Your App The IFrameworkView class: The main interface class required for Windows Store apps. It controls the main event processing loop and maintains the overall state of the game. The DirectXApp class in the demo extends this interface for us. ref class DirectXApp : public Windows::ApplicationModel::Core::IFrameworkView { /* App code here! */ } But we also need a class to create the view…

The IFrameworkView and Your App The DirectXAppSource class extends IFrameworkViewSource. Which is responsible for creating our view. ref class DirectXAppSource : Windows::ApplicationModel::Core::IFrameworkViewSource { public: virtual Windows::ApplicationModel::Core::IFrameworkView^ CreateView(); }; IFrameworkView^ DirectXAppSource::CreateView() return ref new DirectXApp(); }

The IFrameworkView and Your App As usual the main function kicks everything off. It creates an instance of our source class. Then it instructs the CoreApplication singleton class to run the instance. This starts a process which ends in the creation and initialization of your view class. [Platform::MTAThread] int main(Platform::Array<Platform::String^>^) { auto directXAppSource = ref new DirectXAppSource(); CoreApplication::Run(directXAppSource); return 0; }

The IFrameworkView and Your App What dos the DirectXApp class do? Drives and maintains the main state machine for the game. Creates and maintains three important references to the three major objects used in the game: MoveLookController – handles the input. SumoDX – handles the game’s logic and physics. GameRenderer – renders the game’s objects to the screen. It also registers and responds to the necessary Windows Store app events that may occur over the course of the game.

The Basic Game Loop Lets take a look at the pseudo-code for a basic game loop. while the window is active if the window is visible if the game can’t function do to size, or a pop-up, or is simply paused wait for a new event that changes the state of the app. else do the normal processing of incoming messages. update the state of the game and carry out associated actions for that state. then get an updated rendering of the current screen. Process events until we are the visible window. Exiting due to window closing. Make sure to save the game’s state.

Taking a walk through the DirectXApp class.

The Update Stage The Update function of the game loop is where the majority of your game’s logic and state control will occur. It will handle the initial loading and intro sequences as your game boots up. It will handle transitions between levels, in-game menus and other situations that interrupt the game play such as pop-up messages. It will be responsible for updating the controller, which listens for the player’s input. Most importantly it will be responsible for updating the state of the game world and all of the objects in it.

What’s in the DirectXApp’s Update function.

The Render Stage After the game has finished its Update stage it moves into the Rendering stage. The render stage can be broken up into various parts depending on the complexity of the visuals required by the game. Some systems require multiple passes for advanced effects like dynamic shadows, x-ray vision and thermal vision. Some systems also require that every other visit to the rendering system alternates between two slightly different camera positions in order to support stereoscopic games.

The Render Stage The steps of a basic game rendering stage: Set where/what you are rendering too. (back buffer, a texture, etc.) Clear the “screen”, if required/desired. Render your 3D objects. Render your HUDs/2D graphics. Render any pop-up or device message warnings. Present the image to the display. In the demo we created a class called GameRenderer to handle all of this for our DirectXApp via its Render() function.

What takes place during the Demo’s render stage.