Sony playstation graphics in a crunch
This presentation is the property of its rightful owner.
Sponsored Links
1 / 70

Sony Playstation: Graphics in a Crunch PowerPoint PPT Presentation


  • 46 Views
  • Uploaded on
  • Presentation posted in: General

Sony Playstation: Graphics in a Crunch. By Paul Zimmons. PSX Sources:. http://www.classicgaming.com/aec/css/html/psx_development.html http://psx.rules.org/ http://dev.paradogs.com/ http://www.eetimes.com More sources listed for PS2. History.

Download Presentation

Sony Playstation: Graphics in a Crunch

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


Sony playstation graphics in a crunch

Sony Playstation:Graphics in a Crunch

By

Paul Zimmons


Psx sources

PSX Sources:

  • http://www.classicgaming.com/aec/css/html/psx_development.html

  • http://psx.rules.org/

  • http://dev.paradogs.com/

  • http://www.eetimes.com

  • More sources listed for PS2


History

History

  • Play Station was announced in June 1991 at the CES

    • Part of a deal with Nintendo to add a CD-ROM attachment to the Super Nintendo system

    • The deal fell through

  • 1993 - PlayStation-X announced

  • December 3, 1994 - Japan release - $387

    • 300,000 units in 30 days

  • September 9, 1995 - US release - $299


December 1994

December 1994

  • Onyx RealityEngine 2 was king ~ $100K

  • Indigo just starting ~ $15-30K

  • PC - Pentium 90, 16M, 1M Video, 500M

  • Mac - 100 Mhz PPC604, 16M, 2M Video, 500M HD announced for Q2 1995

  • Doom II came out October 10, 1994


Your pc in 1994

Your PC in 1994


Your playstation in 1994

Your Playstation in 1994


People of psx

People of PSX

  • Ken Kutaragi

    • ‘Father’ of the Playstation

    • Designed audio chip for initial defunct SNES Nintendo deal

    • Headed Playstation project

  • Masakazu Suzuoki ([email protected])

    • More technical

  • Design started in May 1992 (CD, 1M transistors goals)


Psx hw overview

PSX HW Overview

  • MIPS R3000A main CPU at 33.8688Mhz

    • 32 bit processor, 4KB I cache, 1 KB D cache

  • 2 MB of main system memory

  • 1 MB of video memory, 2KB tex cache

  • 32 bit bus, 132 Mbyte/sec

  • 2x CD-ROM (300KB/sec)

  • 512 KB Sound buffer, 24 simul. Sounds

  • ~300 K unlit no tex poly/sec


Cpu notes

CPU Notes

  • Some ranges of logical memory space benefit from I cache, some don’t

  • D cache is accessible by programmers

  • Between CPU to main memory are

    • I cache, R buffer (reads),W buffer (writes)

  • Buffers speed up ops but make exact program prediction nearly impossible


Sound notes

Sound Notes

  • Pitch can be changed on the fly

  • Pitch of one sound can be varied by the volume of another sound

  • Pseudo random noise built in (changed by clock changes)

  • Attack, decay, sustain, release

  • Separate reverb unit

  • Buffer is used for reverb, SPU, xfers to MM


Graphics overview

Graphics Overview


Geometry transform engine

Geometry Transform Engine

  • Coordinate Transforms

  • Light Source Calculations

  • Coprocessor for the CPU (separate chip)

    • Fixed point matrix and vector ops

    • Sin, Cos on R3000 (rot matrices)

  • Operates in parallel

  • 1 sign bit, 3 integer bits, 12 fraction bits


Sony playstation graphics in a crunch

GPU

  • Receives drawing instructions from the CPU

  • Addresses from the CPU map to the frame buffer

  • Textures and palettes are sent from the CPU to the frame buffer

  • GPU uses that info with the coordinates and color info (lighting) from the GTE


Frame buffer

Frame Buffer

  • Dual ported, can also go direct MM to FB

    • Can draw while you display


Frame buffer1

Frame Buffer

  • Supports 256x240 up to 640x480

    • Can do interlaced or not

  • 15 bit color or 24 bit color (no ops in 24)


Frame buffer2

Frame Buffer

  • 640x480x24 is really done as 960x480x16

    • Virtual bits per pixel

  • GPU only works on 16 bits so no drawing while showing a movie sequence

  • Frame buffer is used for current output, drawing area, textures and color tables

    • Color palette = color table = CLUT = color look up table = color index mode

    • No separate texture memory


Typical frame buffer layout

Typical Frame Buffer Layout

Can also change drawing environment properties while drawing.


Primitive types

Primitive Types

  • Data is in Main Memory

    • Drawing primitives - seen on screen

    • Special primitives - change drawing parameters while drawing occurs

  • Polygon Primitive

    • 3 or 4 sides, flat or Gouraud, textured or not

  • Line Primitive

    • Line (A,B), (A,B,C), (A,B,C,D), gradient or no


Primitive types1

Primitive Types

  • Sprite Primitive - rectangle

    • Sprite - tex map, Tile - no tex map

    • free, 1x1, 8x8, 16x16 pixels

  • Special Primitive

    • Change window, window clipping, texture window, drawing offset


Drawing primitives

Drawing Primitives

  • Draw on pixel centers, pixel center inside OK

  • Pixel center outside has rules

    • If pixel to right is inside -> draw

    • If pixel to left is inside -> no draw

    • If pixel above is inside -> no draw

    • If pixel below is inside -> draw

  • Don’t draw boundaries more than once


Ordering tables

Ordering Tables

  • Like Word diagrams (grouping, order)

  • Similar to a linked list (draw1->draw2)

  • GPU renders while CPU goes on


Z sorting with ordering tables

Z Sorting with Ordering Tables

  • Calculate the primitives position in the table based on its Z value

  • GTE creates ordering table while converting (x,y,z) coordinates to (xs,ys), zw/4 returned

  • 256 entries: AddPoly(ot+256-z, poly0)

    • i.e. Painter’s algorithm style back to front

    • Last -> Next to Last -> Before that -> ..closest


Reverse ot

Reverse OT

  • Normal OT approaches 0 close to viewer (!)

  • Let’s try 1/z

    • Index into OT with 1/z

    • But then we are indexing in reverse

    • Reverse the order of the table

  • OT: ot[0]->ot[1]->… ot[SIZE-1]

  • ROT: ot[SIZE-1]->ot[SIZE-2] … ->ot[0]


Transform to screen

Transform to Screen

  • (Wx,Wy,Wz) - World, (Sx,Sy,Sz) - Screen

  • (m00, m01.. m22) - rotation matrix


Now perspective xform

Now Perspective Xform

  • Project onto screen

  • Distance h from the viewer

Sy

Sz

h


Packet buffers

Packet Buffers

  • PB=Area in memory for OT and primitives

  • CPU and graphics are not in parallel

  • Have two sets of Packet Buffers


Texture mapping

Texture Mapping

  • Textures are stored in the frame buffer

    • Textures are in Texture Pages (256 x 256)

    • X coord multiple of 64, Y multiple of 256

  • 4, 8, 16 bit (15+1)

  • 4, 8 use CLUT (palette of 16 or 256 colors)


Texture cache

Texture Cache

  • GPU has 2K of texture cache

  • Faster than the frame buffer reads

  • Texture reads fill the texture cache

    • Subsequent reads hit the cache

    • Depends on your bits per pixel

      • 4 bpp ==> 64x64 pixels saved

      • 8 bpp ==>64x32 pixels saved

      • 16 bpp ==> 32x32 pixels saved


Performance

Performance

  • Large polygons directly mean longer render time

  • Semi-transparent takes longer (R+W vs. W)

  • # of reads and writes is frame time

  • 4 bit means 4 texels per read


Performance calculation

Performance Calculation

  • Cycles for 100x100 texture to 1/2 size 50x100 in 4 bit mode, cache misses always

    • Read: 100x100/4 = 2500

    • Write: 50x100 = 5000

    • Total: 7500

  • So half texture size does not mean half the time

    • Ratio gets bad if texture is oblique to viewer


More performance

More Performance

  • Enlarging textures is faster than reducing

    • Texture cache receives multiple hits per pixel

  • No filtering

  • If you always hit the cache (never read from the frame buffer), 4, 8, 16 bits all take same time

    • Or if you make a repeated pattern small enough

  • Clipping generates empty cycles

    • Above and below OK but not side to side


Texture mapping1

Texture Mapping

  • No Z used, no perspective

  • Perspective correct is:

U = a0*x + a1*y + a2

V = b0*x + b1*y + b2

U = (a0*x + a1*y + a2*z + a3) /

(c0*x + c1*y + c2*z + c3)

V = b0*x + b1*y + b2*z + b3 /

(c0*x + c1*y + c2*z + c3)


Texture mapping2

Texture Mapping

  • If z value doesn’t vary much then OK

  • Otherwise you get:

  • Diagonal distortions of textures (split polys)


Geometry transforms

Geometry Transforms

  • Local coord -> World coord -> Screen

    • Local has rot and trans to world

    • World has rot and trans to viewer

    • Can concatenate to 3x3 mult and vec add

    • Then divide to do perspective correct

  • Lighting is similar (loc normal to world)


Normal line clipping

Normal Line Clipping

  • Back face culling (in screen space)

  • Order of vertices in screen space seems to determine whether they are back face or not

0

1

2


Depth cueing

Depth Cueing

  • Use vertex colors (and blend)

    • Only done with black or if texture and back are close together

  • Use texture

    • Use MIP MAP but farther maps are darker

      • MIP MAP based on ‘size’ of polygon => depth

    • Can also change CLUT based on drawing order


Mip map

MIP MAP

  • Must be within the same texture page


Meshing

Meshing

  • Strip Mesh

  • Round Mesh


Ps x os

<PS-X OS>

  • Environment for developer and program control

  • Takes up max of 64 KB of RAM

  • OS System table are not hidden for speed

    • Careful programming

  • Multi-tasking OS (background music + drawing)

  • Multiple file systems (through driver)


Sony playstation graphics in a crunch

PS2

  • Totally different


Ps 2 sources

PS 2 Sources

  • 2 Main Papers:

    • “A Microprocessor with a 128-Bit CPU, Ten Floating-Point MAC’s, Four Floating-Point Dividers,, and an MPEG-2 Decoder” by Masakazu Suzuoki et al. In IEEE Journal of Solid-State Circuits Vol 14. No. 11, November 1999. Page 1608 - 1618

    • “Designing and Programming the Emotion Engine” by Masaaki Oka and Masakazu Suzuoki. IEEE Micro November-December 1999. Pages 20-28.

  • Chip Images

    • http://fuji.stanford.edu/seminars/spring99/slides/may13/sld001.html, Slides 29, 30, 36

  • GPU Info: http://www.g-o-l.com/ck/speciali/altro/graphics-synthesizer.pdf


Cpu emotion engine

CPU (Emotion Engine)

  • 250 Mhz

  • 32 MB RAMBUS

  • 2 GB/sec bus

  • MIPS core with vector coprocessors

  • 128 bit internal and external pathways

  • VLIW

  • 10.5 M transistors


Sony playstation graphics in a crunch

CPU


New design goals

New Design Goals

  • Behavior synthesis

    • Dynamices (distance, Newton iterations)

  • Geometry

    • More surface processing

    • Texture compression


Three in one

Three in One

  • RISC core with floating point

    • 128 bit registers

  • Two floating point vector units

    • VPU0 for behavior and physics

    • VPU1 for geometry

  • Independent phyics and geometry

    • Because of penalties with vector processors


Processor organization

Processor Organization


Acronyms

Acronyms

  • IPU = MPEG2 decoder

  • DMAC = direct memory access

  • EFU = elementary function unit

  • SPR = scratch pad RAM

    • Used for communicating between subprocs

  • GIF = graphics synthesizer interface unit

    • Interprets display lists


Vector processing unit

Vector Processing Unit


Sony playstation graphics in a crunch

VPU

  • 4D quantities (x,y,z,w), (r,g,b,a)

    • 4 multiply accumulators (FMAC)

  • Big penalties for branches and context switches and interrupts

  • Cache

    • Swap out big chunks at a time

    • VLIW bad efficiency

  • Break into two parts


Vpu continued

VPU continued

  • VPU0 same design as VPU1

    • VPU0 is connected to CPU, VPU1 indep.

  • 128 bits (32 for x, y, z, w), 4 FMACs

    • 1 cycle for xyzw3 = xyzw0 * xyzw1 + xyzw2

  • 64 bit instructions

    • 2 32 bit instructions simultaneously

  • 7 cycle (pipelined) 4x4

  • VPU1 gets Macro Program for Disp List


2 instructions per cycle

2 Instructions per Cycle


Vpu cont d

VPU cont’d

  • VPU1 does geometry

    • Has dedicated path to rendering engine

  • VPU0 + CPU can generate VPU1 data which goes to rendering engine

    • Scratch pad RAM acts as talk between VPU0, Rendering Engine, and VPU1

  • VPUs can both generate display lists asynchronously and both go to the rendering engine


Texture compression

Texture Compression

  • MPEG-2

    • Inverse discrete cosine transform and then quantize to create paletted textures

  • Textures are stored compressed

    • Differential information from lowest res.

    • IPU decompresses


Memory architecture

Memory Architecture

  • PSX2 is NOT a PC

  • PSX2 has around 150KB of cache

    • Itanium 2-4 MB

  • Originally thought of snoopy cache

    • Too unpredictable, simple wins out

      • Double buffered memory (huh?)

  • Much more controlled environment

  • CPU controls memory accesses


Performance1

Performance


Comparison

Comparison


Graphics synthesizer

Graphics Synthesizer


Graphics synthesizer1

Graphics Synthesizer

  • 147.456 Mhz, 42.7 M transistors

  • Embedded 4MB DRAM @ 150 Mhz

    • Read/modify/write = 1 cycle

  • 48 GB/sec, 2560 bit interface

  • 32 bit Z buffer, 24 bit color, 8 bit alpha

  • 16 parallel pixel pipelines

  • 1.2 Gigapixels/sec (Z buffer, alpha, texture)


Relative performance from sony

Relative Performance (from Sony)


Graphics synthesizer2

Graphics Synthesizer

  • R: 1024 Bit W: 1024 Bit T: 512 Bit

  • Multi-pass, Bi- Tri-linear filtering, MIP MAP, antialiasing, bump map, reflection, refraction

  • 30 M Tris/sec with alpha and Z (50pxl tri)

  • 150 M particles / sec

  • NTSC to 1280x1024


Sony playstation graphics in a crunch

FX

  • Accumulation buffer style effects

  • Water effects

  • Cloth (spring mesh)

  • Particle systems

  • Smoke

  • Displacement maps (bump)

  • General shadows

  • Bezier surfaces


Other ps2 facts

Other PS2 Facts

  • 4x DVD-ROM ~ 24x CD-ROM

  • PC Card (Type III)

  • 48 simultanous voices

  • Can play old PSX games

  • USB Port

  • FireWire Port

  • Optical Digital Output (for digital TV)

  • PSX2 Simulator runs on Linux


Sony playstation graphics in a crunch

Original Model Render


  • Login