SLIDE 1
Week 1 -Wednesday
SLIDE 2 What did we talk about last time? Introduction to the course Colors
SLIDE 3
SLIDE 4
SLIDE 5
We will be thinking of images as linear buffers of data (which
will usually store R,G,B and sometimes A values for each pixel)
Bitmaps (.bmp files) are almost that simple Most common image formats (.jpg, .png, and .gif files)
are more complex
They use different forms of compression to keep the image
size small
Otherwise, an 800 x 600 image is 3 bytes per pixel x 800 x 600
= 1,440,000 bytes > 1 MB
SLIDE 6
Stands for Joint Photographic Experts Group Good for images without too much high contrast
(sharp edges)
Photographs are often stored as JPEGs Uses crazy math (discrete cosine transform) to
reduce the amount of data needed
Lossy compression
SLIDE 7 Good for images with low numbers of colors and high contrast
differences
Has built-in compression sort of like zip files Similar to the older GIF (.gif) images
- GIFs are unpopular now because they only support 256 colors
- GIFs also suffered from legal battles over the algorithm used for
compression
Lossless compression
SLIDE 8 Tagged image file format (.tiff or .tif) images are another
standard sometimes used in computer graphics or for scanned images
- The TIFF standard is really crazy, supporting layers, LZW style
compressions, JPEG style compression
DirectDraw surface container (.dds) files were designed for
DirectX, allowing for the S3 Texture Compression algorithm
- The pixel data is easily to decompress in hardware
TARGA (.tga) files have a very simple structure and are still used
for some textures
SLIDE 9
SLIDE 10
SLIDE 11 What do we have?
- Virtual camera (viewpoint)
- 3D objects
- Light sources
- Shading
- Textures
What do we want?
SLIDE 12 The idea of a pipeline is to divide a task into independent
steps, each of which can be performed by dedicated hardware
Example RISC pipeline: 1.
Instruction fetch
3.
Execute
- 4. Memory Access
- 5. Writeback
SLIDE 13
If you have an n stage pipeline, what's the maximum speedup you can
get?
Consider a TV show with the following pipeline 1.
Write
2.
Rewrite
3.
Film
4.
Edit
Assume each step takes 1 week How much total time does it take to produce a 13 episode season? What if there was no pipelining? Note that a pipeline's speed is limited by its slowest stage, the bottleneck
SLIDE 14
For API design, practical top-down problem solving, and
hardware design, and efficiency, rendering is described as a pipeline
This pipeline contains three conceptual stages:
Produces material to be rendered
Application
Decides what, how, and where to render
Geometry
Renders the final image
Rasterizer
SLIDE 15 These conceptual stages may or may not be running at the
same time
Each conceptual stage may contain its own internal pipelines
SLIDE 16
A critical concern of real time rendering is the rendering
speed, determined by the slowest stage in the pipeline
We can measure speed in frames per second (fps), common
for average performance over time
We can also measure speed in Hertz (Hz), common for
hardware
SLIDE 17 Output device has a maximum update frequency of 60 Hz (very
common for LCDs)
The bottleneck rendering stage is 62.5 ms What's our rendering speed?
- 1/0.0625 = 16 fps
- 60/1 = 60 fps
- 60/2 = 30 fps
- 60/3 = 20 fps
- 60/4 = 15 fps
- 60/5 = 12 fps
SLIDE 18
SLIDE 19 The application stage is the stage completely controlled by
the programmer
As the application develops, many changes of
implementation may be done to improve performance
The output of the application stage are rendering primitives
SLIDE 20
Reading input Managing non-graphical output Texture animation Animation via transforms Collision detection Updating the state of the world in general
SLIDE 21 The Application Stage also handles a lot of acceleration Most of this acceleration is telling the renderer what NOT to
render
Acceleration algorithms
- Hierarchical view frustum culling
- BSP trees
- Quadtrees
- Octrees
SLIDE 22
An application can remove those objects that are not in the
cone of visibility
Hierarchies of objects can be used to make these calculations
easier
SLIDE 23
Splitting planes are made through polygons to repeatedly
subdivide the polygons in a scene in half
Often, BSP Trees are calculated a single time for complex,
static scenes
SLIDE 24 Like BSP's, the space can be repeatedly subdivided as long as
it contains a number of objects above a certain threshold
Octrees divide the space in three dimensions while quadtrees
SLIDE 25
SLIDE 26
C# and MonoGame overview
SLIDE 27 No required reading ahead of time But, checking out MonoGame is not a bad idea To run it on your own machine, you'll need Visual Studio 2015
Community
- Freely available
- Alternatively, you can talk to Professor Stucki about getting the
Enterprise edition, but those features won't be useful for this class