advanced programming for 3d graphics applications l.
Skip this Video
Loading SlideShow in 5 Seconds..
Advanced programming for 3D Graphics Applications PowerPoint Presentation
Download Presentation
Advanced programming for 3D Graphics Applications

Loading in 2 Seconds...

play fullscreen
1 / 29

Advanced programming for 3D Graphics Applications - PowerPoint PPT Presentation

  • Uploaded on

Advanced programming for 3D Graphics Applications Console developement Components of a Video Game 3D graphics User interaction Sound effects and music 3D models 2D textures Animation Game and level design Immersion, excitement, alternate reality

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

Advanced programming for 3D Graphics Applications

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
components of a video game
Components of a Video Game
  • 3D graphics
  • User interaction
  • Sound effects and music
  • 3D models
  • 2D textures
  • Animation
  • Game and level design
  • Immersion, excitement, alternate reality
playstation net yaroze 1997 official hobbyist game development
PlayStation Net Yaroze (1997)(Official “hobbyist” Game Development)
  • Host-target Development
  • Net Yaroze games dev libraries
  • No access to hardware
  • Sub-optimal Performance

PlayStation2 Games Console

European Launch: November 2000

professional development environment the tool







Professional Development EnvironmentThe TOOL
  • Use the Linux-based tools that come with the TOOL
  • Use third party dev tools such as CodeWarrior or SN systems
playstation2 linux kit may 2002
PlayStation2 Linux Kit – May 2002
  • USB keyboard & mouse
  • 10/100 Ethernet Adapter
  • 40GB Hard Disk
  • DVDs
    • Linux operating system
    • Hardware Manuals
    • Development Tools
    • Example Applications
graphics transformation pipeline
Graphics Transformation Pipeline
  • Transforms vertices from model or local space to 2D screen space for rasterisation
ps2 specific pipeline
PS2 Specific Pipeline
  • Transformation Matrices built by CPU
  • Matrices and untransformed vertex data sent to VU1
  • VU1 performs vertex transformation, clipping, lighting, view port scaling.
  • Transformed data sent to GS.
  • GS performs texturing and rasterisation.
  • All above (3 processes) can run in parallel !!
organisation of memory
Organisation of Memory
  • Dynamic buffer contains data that changes from frame to frame, e.g. transformed data, transformation matrices.
  • Two dynamic buffers needed to exploit parallelism of PS2
  • One buffer is being compiled by the CPU whilst the other is being sent for rendering.
  • Utilises Parallelism of PS2

Swap Every Frame

Written by CPU

Read by DMAC

the game loop
The Game Loop



Fire(); // Start data transfer

GetUserInput(); //

DoGameLogic(); // AI, Physics, Logic….

// Following code ONLY puts render data into memory

BeginScene(); // Clear frame buffer

SetStaticData(); // textures, 3d models etc

SetDynamicData(); // Matrices, T&L, etc.

EndScene(); // Wait for previous frame to render


architecture of vu1
Architecture of VU1
  • 16k data memory, address in qwords (128-bit)
  • 16k program memory, address in dwords (64-bit)
  • 32 x 128-bit floating point registers
  • 16 x 16-bit integer registers (newbie killer!)
  • Two execution units (upper and lower)
  • Special registers (ACC, I, Q, R, P)
  • Dual stream assembly language (.vsm file)
  • VU assembler provided by Sony (ee-dvp-as)
    • Latency, scheduling, pairing, issues.
typical vsm assembly dual stream
Typical vsm assembly (dual stream)

NOP lq VF06,7(VI02)

mulax ACC,VF02,VF06x iaddiu VI01,VI01,0x00000001

madday ACC,VF03,VF06y iaddiu VI02,VI02,0x00000002

maddaz ACC,VF04,VF06z NOP

maddw VF06,VF05,VF06w NOP



NOP NOP ACC,VF01,VF00w div Q,VF00w,VF06w






NOP NOP VF06,VF06,Q waitq




typical vcl single stream
Typical VCL(Single Stream)


lq Vert, StartVert(iVertPtr)

MatrixMultiplyVertex Vert, fTransform, Vert

div q, vf00[w], Vert[w] Vert, Vert, q acc, fScales, vf00[w] Vert, Vert, fScales Vert, Vert

why is the ps2 used
Why is the PS2 used?
  • Introduce console development topics
  • 2D graphics, frame buffers, graphics packets, graphics processors, memory management, console architecture….
  • 3D graphics, 3D console architecture, Vector Units, Parallel processing, vertex transformation, clipping, lighting.
  • C++ concepts in a games context, Sprite classes etc., structure of a games program, Low level vertex processing.
  • Creating a 3D game engine
development tools
Development Tools
  • GNU gcc and g++ compilers
  • GNU gdb debugger!
  • Vector Command Line Pre-processor
  • Vector Unit assembler
  • Visual Vector Unit Debugger
  • Development can be done “offline” with Visual Studio”
sps2 direct access environment
SPS2: Direct Access Environment
  • Developed by PS2Linux developer community
  • 1.What is it?
  • 2.Why use it?
  • 3.How do I use it?
  • 4.Are there disadvantages?
what is sps2
What is SPS2?
  • •Kernel module loaded at runtime
  • •Gives direct access to the hardware
  • •Has been used to create samples requiring lots of processing power
  • •Linux friendly
  • Required for DMA transfers
  • –Guarantee to have unswappable/unmovable memory
  • •Only 4kb continuous memory is guarantied
  • –Physical address of memory
  • •You fill the buffers using Linux virtual addresses and sends the data using physical addresses
  • –Direct access to the hardware registers
  • •EE
  • •GS
•DMA packet checker
  • –Set of functions for debugging purposes
  • –Helps prevent crashes
  • •Easy to crash the system
  • •Very good documentation
  • •Samples to illustrate usage
  • •Currently being developed and improved
  • •The module can be installed/uninstalled at runtime
  • –No need to recompile the kernel
  • –No memory is reserved
  • –No need to even reboot
how to use sps2
How to use SPS2
  • •Load the kernel at runtime
  • –Scripts are provided to make it easy
  • •Use the library provided
  • –Just a set of headers to include
  • –System calls are taken care of
  • •Build DMA packets the same way you’d do on a DevKit
  • –Use memory allocated by the module
  • –Build small 4kb chunks linked in a chain
  • •Use macros to set the DMA registers
  • –Macros are assembly code writing directly to the registers
sps2 project framework
SPS2 project framework
  • •Written by members of the community
  • –Professional developers
  • •Takes cares of display initialisation
  • •Deals with DMA packet building
  • •Provides a solid base for your code
  • •Samples of advanced techniques used in a game
  • –Mskpath3
  • –Bump mapping
  • –Interlock
  • Games Employers Value Console Skills
  • Steep learning curve for students
  • In-house development framework needed
  • Similarities to Pro-development
  • Motivational for students
  • Introduces Linux & Linux development tool chain