1 / 27

COMP 4290

This text provides an introduction to different image formats, including JPEG, PNG, GIF, and others. It also explains the concept of a graphics rendering pipeline and its stages.

hgarrido
Télécharger la présentation

COMP 4290

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Week 1 - Wednesday COMP 4290

  2. Last time • What did we talk about last time? • Introduction to the course • Colors • RGB • CMYK • HSL and HSV

  3. Questions?

  4. Image Formats

  5. Real world image formats • 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

  6. JPEG or JPG images • 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

  7. PNG images • 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

  8. Others • 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

  9. Student Lecture: Graphics Rendering Pipeline and Application Stage

  10. Graphics Rendering Pipeline

  11. Rendering • What do we have? • Virtual camera (viewpoint) • 3D objects • Light sources • Shading • Textures • What do we want? • 2D image

  12. Pipelines • 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: • Instruction fetch • Decode • Execute • Memory Access • Writeback

  13. Pipeline performance • If you have an n stage pipeline, what's the maximum speedup you can get? • Consider a TV show with the following pipeline • Write • Rewrite • Film • 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

  14. Graphics rendering pipeline • 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:

  15. Architecture • These conceptual stages may or may not be running at the same time • Each conceptual stage may contain its own internal pipelines or parallel execution

  16. Speed • 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

  17. Rendering speed example • 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

  18. Application Stage

  19. Application stage • 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 • Points • Lines • Triangles

  20. Important jobs of the application stage • Reading input • Managing non-graphical output • Texture animation • Animation via transforms • Collision detection • Updating the state of the world in general

  21. Acceleration • 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

  22. Hierarchical view frustum culling • 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

  23. BSP Trees • 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

  24. Quadtrees and Octrees • 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 only focus on two

  25. Upcoming

  26. Next time… • C# and MonoGame overview

  27. Reminders • 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

More Related