Presentation is loading. Please wait.

Presentation is loading. Please wait.

2/14/2016 310482: Graphics Programming Seree Chinodom

Similar presentations


Presentation on theme: "2/14/2016 310482: Graphics Programming Seree Chinodom"— Presentation transcript:

1 2/14/2016 310482: Graphics Programming Seree Chinodom seree@buu.ac.th http://www.compsci.buu.ac.th/~seree/lecture/310482

2 2/14/2016 Display Technologies l Cathode Ray Tubes (CRTs) –Most common display device today –Evacuated glass bottle –Extremely high voltage –Heating element (filament) –Electrons pulled towards anode focusing cylinder –Vertical and horizontal deflection plates –Beam strikes phosphor coating on front of tube

3 2/14/2016 Electron Gun l Contains a filament that, when heated, emits a stream of electrons l Electrons are focused with an electromagnet into a sharp beam and directed to a specific point of the face of the picture tube l The front surface of the picture tube is coated with small phospher dots l When the beam hits a phospher dot it glows with a brightness proportional to the strength of the beam and how often it is excited by the beam

4 2/14/2016 Display Technologies: CRTs l Vector Displays –Early computer displays: basically an oscilloscope –Control X,Y with vertical/horizontal plate voltage –Often used intensity as Z l Name two disadvantages Just does wireframe Complex scenes  visible flicker

5 2/14/2016 Display Technologies: CRTs l Raster Displays –Raster: A rectangular array of points or dots –Pixel: One dot or picture element of the raster –Scan line: A row of pixels

6 2/14/2016 Display Technologies: CRTs l Raster Displays –Black and white television: an oscilloscope with a fixed scan pattern: left to right, top to bottom –To paint the screen, computer needs to synchronize with the scanning pattern of raster n Solution: special memory to buffer image with scan-out synchronous to the raster. We call this the framebuffer.

7 2/14/2016 Display Technologies: CRTs l Phosphers –Flourescence: Light emitted while the phospher is being struck by electrons –Phospherescence: Light emitted once the electron beam is removed –Persistence: The time from the removal of the excitation to the moment when phospherescence has decayed to 10% of the initial light output

8 2/14/2016 Display Technologies: CRTs l Raster Displays –Frame must be “refreshed” to draw new images –As new pixels are struck by electron beam, others are decaying –Electron beam must hit all pixels frequently to eliminate flicker –Critical fusion frequency n Typically 60 times/sec n Varies with intensity, individuals, phospher persistence, lighting...

9 2/14/2016 Display Technologies: CRTs l Raster Displays –Interlaced Scanning –Assume can only scan 30 times / second –To reduce flicker, divide frame into two “fields” of odd and even lines 1/30 Sec 1/60 Sec Field 1 Field 2 Frame

10 2/14/2016 Display Technologies: CRTs l Raster Displays –Scanning (left to right, top to bottom) n Vertical Sync Pulse: Signals the start of the next field n Vertical Retrace: Time needed to get from the bottom of the current field to the top of the next field n Horizontal Sync Pulse: Signals the start of the new scan line n Horizontal Retrace: The time needed to get from the end of the current scan line to the start of the next scan line

11 2/14/2016 Display Technology: Color CRTs l Color CRTs are much more complicated –Requires manufacturing very precise geometry –Uses a pattern of color phosphors on the screen: –Why red, green, and blue phosphors? Delta electron gun arrangementIn-line electron gun arrangement

12 2/14/2016 Display Technology: Color CRTs l Color CRTs have –Three electron guns –A metal shadow mask to differentiate the beams

13 2/14/2016 Display Technology: Raster l Raster CRT pros: –Allows solids, not just wireframes –Leverages low-cost CRT technology (i.e., TVs) –Bright! Display emits light l Cons: –Requires screen-size memory array –Discreet sampling (pixels) –Practical limit on size (call it 40 inches) –Bulky –Finicky (convergence, warp, etc)

14 2/14/2016 Display Technology: LCDs l Liquid Crystal Displays (LCDs) –LCDs: organic molecules, naturally in crystalline state, that liquefy when excited by heat or E field –Crystalline state twists polarized light 90º

15 2/14/2016 Display Technology: LCDs l Transmissive & reflective LCDs: –LCDs act as light valves, not light emitters, and thus rely on an external light source. –Laptop screen: backlit, transmissive display –Palm Pilot/Game Boy: reflective display

16 2/14/2016 Display Technology: Plasma l Plasma display panels –Similar in principle to fluorescent light tubes –Small gas-filled capsules are excited by electric field, emits UV light –UV excites phosphor –Phosphor relaxes, emits some other color

17 2/14/2016 Display Technology l Plasma Display Panel Pros –Large viewing angle –Good for large-format displays –Fairly bright l Cons –Expensive –Large pixels (~1 mm versus ~0.2 mm) –Phosphors gradually deplete –Less bright than CRTs, using more power

18 2/14/2016 Display Technology: DMDs l Digital Micromirror Devices (projectors) –Microelectromechanical (MEM) devices, fabricated with VLSI techniques

19 2/14/2016 Display Technology: DMDs l DMDs are truly digital pixels l Vary grey levels by modulating pulse length l Color: multiple chips, or color-wheel l Great resolution l Very bright l Flicker problems

20 2/14/2016 Display Technologies: Organic LED Arrays l Organic Light-Emitting Diode (OLED) Arrays –The display of the future? Many think so. –OLEDs function like regular semiconductor LEDs –But with thin-film polymer construction: n Thin-film deposition or vacuum deposition process…not grown like a crystal, no high-temperature doping n Thus, easier to create large-area OLED sheet

21 2/14/2016 Display Technologies: Organic LED Arrays l OLED pros: –Transparent –Flexible –Light-emitting, and quite bright (daylight visible) –Large viewing angle –Fast (< 1 microsecond off-on-off) –Can be made large or small l OLED cons: –Not quite there yet (96x64 displays…) –Not very robust, display lifetime a key issue

22 2/14/2016 Raster Scan Displays l Beam of electrons deflected onto a phosphor coated screen – Phosphors emit light when excited by the electrons – Phosphor brightness decays -- need to refresh the display – Phosphors make up screen elements called pixels

23 2/14/2016 Basic Definitions Raster: A rectangular array of points or dots. Pixel (Pel): One dot or picture element of the raster Scan line: A row of pixels Video raster devices display an image by sequentially drawing out the pixels of the scan lines that form the raster.

24 2/14/2016 Frame Buffers l A frame buffer may be thought of as computer memory organized as a two-dimensional array with each (x,y) addressable location corresponding to one pixel. l Bit Planes or Bit Depth is the number of bits corresponding to each pixel. l A typical frame buffer resolution might be 640 x 480 x 8 1280 x 1024 x 8 1280 x 1024 x 24

25 2/14/2016 1-Bit Memory, Monochrome Display (Bitmap Display)

26 2/14/2016 3-Bit Color Display

27 2/14/2016 True Color Display Red Blue 8 8 8 24 bitplanes, 8 bits per color gun. 2 24 = 16,777,216

28 2/14/2016 Color Map Look-Up Tables Extends the number of colors that can be displayed by a given number of bit-planes. 6 7 100110100001 0 67 255 100110100001 RG B RED GREEN BLUE Pixel displayed at x', y' Pixel in bit map at x', y' 0 x 0 y x max y Frame bufferLook-up tableDisplay

29 2/14/2016 Pseudo color 2 8 x 24 Color Map LUT

30 2/14/2016 Drawing l Most computer generated images made up of geometric primitives (polygons, lines, points) l Application draws them by setting bits in the framebuffer l Most graphics applications involve scene database management Scene Database Graphic Application Device Driver Framebuffer Display

31 2/14/2016 A DDA Line Drawing Function Line(int x1, int y1, int x2, int y2) { int dx = x1 - x2, dy =y2 -y1; int n = max(abs(dx),abs(dy)); float dt = n, dxdt = dx/dt, dydt = dy/dt; float x = x1, y = y1; while (n--) { DrawPoint( round(x), round(y) ); x +=dxdt; y +=dydt; }

32 2/14/2016 We Can Do Better Than That... l Get rid of all those nasty floating point operations l The idea: find the next pixel from the current one l So which of the green pixels is next?

33 2/14/2016 The Key l We’re only ever going to go right one pixel, or up and right one pixel (if the slope of the line is between 0 and 1). Call these two choices “E” and “NE” l Let’s think of pixels as “lattice points” on a grid l Given an X coordinate, we only need to choose between y and y+1 (y is the Y coordinate of the last pixel)

34 2/14/2016 The Midpoint Test l Look at the vertical grid line that our line intersects l On which side of the midpoint (y+1/2) does the intersection lie? l If it’s above the midpoint, go NE, otherwise go E

35 2/14/2016 Our Example

36 2/14/2016 Implicit Functions l Normally, a line is defined as y= mx +b l Instead, define,F(x,y) = ax +by + c and let the line be everywhere where F(x,y) = 0 l Now, if F(x,y) > 0, we’re “above” the line, and if F(x,y) < 0, we’re “below” the line

37 2/14/2016 Who Cares? l We can evaluate the implicit line function at the midpoint to figure out where to draw next! l In fact, we can use the last function evaluation to find the next one cheaply! l For ANY x, y: F(x + 1,y) - F(x,y) = a F(x + 1,y + 1) - F(x,y) = a - b

38 2/14/2016 Midpoint Algorithm Line(int x1, int y1, int x2, int y2) { int dx = x2 - x1, dy =y2 -y1; int e = 2*dy - dx; int incrE = 2*dy, incrNE = 2*(dy- dx); int x = x1, y = y1; DrawPoint( x, y ); while (x < x2) { x++; if ( e <= 0 ) { e += incrE; } else { y++; e += incrNE; } DrawPoint( x, y ); } l “e” holds the implicit function evaluation at each x value (actually, it’s multiplied by 2, but all we care about is the sign). Easy extension for lines with arbitrary slopes


Download ppt "2/14/2016 310482: Graphics Programming Seree Chinodom"

Similar presentations


Ads by Google