Computer Graphics Introducing DirectX - PowerPoint PPT Presentation

1 / 16
About This Presentation
Title:

Computer Graphics Introducing DirectX

Description:

For DirectX the other software is the DirectX core and ... Textures, bump mapping environment mapping etc. Special effects. Advanced lighting techniques ... – PowerPoint PPT presentation

Number of Views:486
Avg rating:3.0/5.0
Slides: 17
Provided by: lauren80
Category:

less

Transcript and Presenter's Notes

Title: Computer Graphics Introducing DirectX


1
Computer GraphicsIntroducing DirectX
  • CO2409 Computer Graphics
  • Week 5-2

2
Todays Lecture
  • Terminology
  • A History
  • DirectX Components
  • DirectX Graphics
  • Rendering Pipeline
  • Using DirectX
  • Future Directions

3
Terminology
  • DirectX is an SDK
  • Software Development Kit
  • Set of software tools, APIs and documentation to
    enable development of specialist software
  • DirectX contains a set of APIs
  • Application Program Interfaces
  • An API is a definition of how to interface with
    (i.e. use) some other software or device
  • For DirectX the other software is the DirectX
    core and hardware drivers
  • These APIs take the form of libraries of
    functions and types that can be used in C, C
    etc.
  • The TL-Engine is also used through an API

4
DirectX A History
  • Conceived in 1994
  • Targeted at games developers who preferred DOS
    over the newer Windows operating system
  • Intended to provide low-level access to system
    resources within a high-level OS
  • First few iterations were fairly unusable
  • However, by DirectX 5 provided a reasonable
    development platform
  • Later versions have been developed in close
    collaboration with hardware vendors
  • Currently on DirectX 9.0c for Windows XP
  • DirectX 10 is available only on Windows Vista.

5
DirectX Components
  • DirectX contains three major components
  • DirectX Graphics (or Direct3D)
  • 2D and 3D graphics
  • Low level control and higher level helper
    utilities
  • DirectX Input
  • For keyboard, mouse, joystick other input
    devices.
  • DirectX Sound
  • Capture and playback of sound effects
  • One API for each of these components

6
Previous Components
  • DirectX is generally backwards compatible with
    all previous versions
  • Older components that have since been deprecated
    are still usable, e.g.
  • DirectDraw 2D drawing, superseded
  • DirectPlay Network gaming, deprecated
  • DirectShow Video playback, superseded
  • DirectMusic Music playback - in limbo
  • These components should be avoided
  • Ensure you read the latest documentation
  • Avoid website tutorials for older versions

7
DirectX Graphics
  • Will use DirectX Graphics in this module
  • The SDK provides
  • An API a set of functions and classes
  • We will use this extensively (in C)
  • Full documentation, tutorials and samples
  • Very useful reference
  • Development Tools, mainly regarding pixel, vertex
    geometry shaders
  • We will see a little of these
  • The SDK is on the games lab machines

8
DirectX Graphics Pipeline
  • All the DirectX Graphics features can be
    illustrated as a pipeline of operations
  • From initial geometry to final pixel rendering

Reproduced from the SDK documentation
9
Pipeline Input Data
  • The pipeline starts with vertex and primitive
    data
  • Have seen vertices, primitive data is mainly
    polygons
  • This is the 3D geometry that we have discussed
    already
  • The tessellation stage allows for automatic
    refinement of the original geometry
  • Rarely used

This geometry data is in the form of triangle
strips an important method of storage for 3D
graphics APIs
10
Pipeline Vertex Processing
  • Vertex Processing describes transformations
    applied to the 3D geometry to
  • Position and orient elements
  • Blend geometry for animation
  • Create special effects
  • E.g. deformation
  • But the most important step is to create the 2D
    view of the 3D geometry
  • as seen from a particular point

Transformation from 3D to 2D geometry
11
Pipeline Lighting
  • The vertex processing stage can also calculate
    lighting
  • Three main kinds of lights
  • Directional lights
  • Point lights
  • Spot lights
  • The effects are calculated with some simple
    vector mathematics
  • Note that shadows are dealt with separately from
    lights

Light Types
12
Geometry Pixel Processing
  • These stages describe the conversion of the
    transformed 2D geometry into pixels
  • This covers many topics
  • Clipping, culling, depth buffers
  • Textures, bump mapping environment mapping etc.
  • Special effects
  • Advanced lighting techniques
  • Depth of field
  • Etc. etc

Special per-pixel effects in Half Life 2
13
Pixel Rendering
  • Final blending of the pixels onto the viewport
  • Have seen some of the possibilities here when
    working with sprites
  • E.g. Additive, multiplicative, alpha blending
  • Will cover each pipeline stages using DirectX
  • Stages are similar for other graphics libraries

14
Beyond the Basic Pipeline
  • This describes the basic fixed pipeline
  • Parts of the pipeline are now programmable
  • Vertex, geometry and pixel shaders
  • More flexibility in how processing is performed
  • Will look at fixed pipeline first to introduce
    concepts
  • But quickly move on to the use of shaders
  • Standard development technique nowadays
  • Advanced topics move beyond basic pipeline
  • E.g. shadows, animation

15
Using DirectX
  • First initialise a Windows application and
    prepare DirectX
  • This stage is fairly standard for all DX
    applications
  • Prepare some 3D geometry to render
  • We will look at these two stages in initial labs
  • Then use the DirectX API to program the stages in
    the graphics pipeline
  • Will use a some helper functions to do this
  • A subset of DX Graphics called the D3DX library
  • Designed to be easier to use than the core API

16
DirectX 10
  • DirectX 10 is a major update, compatible only
    with Windows Vista
  • Key changes
  • Refined architecture to suit Vista
  • Vistas GUI now DirectX driven
  • Requires minimum specification for hardware
  • Less need for fall-back techniques on weaker
    hardware
  • Adds geometry shaders
  • Manipulate/generate triangles in a shader
  • Shaders can write back to GPU memory
  • Shaders can dynamically update geometry
  • Reduce CPU work, e.g. particle system entirely on
    GPU
Write a Comment
User Comments (0)
About PowerShow.com