Computer Graphics Basic Maths for Graphics in C++ CO2409 Computer Graphics Week 4.
Computer Graphics with OpenGL · Computer Graphics Introduction To Computer Graphics Asst. Prof....
Transcript of Computer Graphics with OpenGL · Computer Graphics Introduction To Computer Graphics Asst. Prof....
CCS6020 Computer Graphics
Introduction To Computer Graphics
Asst. Prof. Dr. Bujar Raufi
Asst. Dr. Visar Shehu
Computer Science Department Contemporary Sciences And Technologies
South East European University
COURSE MATERIALS
Course Website:
Libri (https://libri.seeu.edu.mk)
Syllabus:
On Libri
A QUESTION?
Where did this image came from?
What hardware/software did we need to produce it?
WHAT IS COMPUTER GRAPHICS ? Computer graphics is concerned with producing
pictures and objects using the computer.
Creating objects & pictures (modelling)
Displaying objects & pictures (rendering)
Interacting with pictures
The field of computer graphics
Methods and Principles (geometry, physics, optics, etc.)
Algorithms and data structures
Software/hardware tools
Applications
COMPUTER GRAPHICS PARADIGMS Traditional (this course): modelling rendering
Other paradigms
Data visualization
Image-based rendering (Google 3D Warehouse)
Computer graphics vs. image processing/vision
Modeling Rendering
user interface
Models pictures
graphics
Image processing/vision
COMPUTER GRAPHICS APPLICATIONS
Entertainment: movie production, animation, special effects, games.
Presentation: Web, e-commerce, publishing, computer art, advertisement, education.
Design: CAD/CAM, ECAD, fashion design, architectural design.
Simulation: complex experiments, flight simulation, surgical simulation, traffic control, power plants, etc.
Graphical user interface(GUI): bitmap window systems, interface tools, VR systems.
Scientific visualization: biological image analysis, medical diagnosis, weather data, satellite data, remote sensing, NASA data, simulation data, etc.
DISPLAY DEVICES
Line-drawing displays (vector display)
Fast, accurate line drawing (e.g. plotter).
Early technology (vector graphics)
Cannot draw smooth & shaded surfaces
Raster display
Current technology (raster graphics)
Pixel based raster screen (CRT)
Supported by frame buffer
High quality realistic images
TYPICAL RASTER GRAPHICS SYSTEM
Graphics Processor (GPU)
Frame Buffer
Monitor (CRT/LCD)
Input devices Output device
Image formed in frame buffer
INPUT DEVICES Physical Input Devices Mouse
Trackball
Data tablet
Joystick
Space ball
Logical Devices (from inside the application) Widget (menus, scrollbars, slidebars,
graphical buttons)
Other customizable graphical elements
GRAPHICS PROCESSOR UNIT (GPU)
‘Co-Processor’ dedicated to Display Operations
Can be emulated by CPU at the cost of speed
Vendor-Specific APIs common
Handle Matrix/Vector operations, texture mapping, shading, depth-buffering and more
FRAME BUFFER
Pixel: the smallest screen unit that can be lighted with a color value independently
Raster: 2D array of pixels
Frame buffer : a 2D array of memory cells made of high speed memory chips, corresponding one-to-one to the raster.
Frame buffer cell: the frame buffer memory cell (often called pixel as well)
1 1 1 1
1 1
1 1
1 1
0
0
0
0
0
0
4x4 Display - 8 bit-planes
8 bits of Colour Information Per Pixel
Resolution=width*height*bitplanes
FRAME BUFFER
COLOR DEPTH
N color bits per pixel = 2N colors
1 bit: 21 = 2 colors (black and white)
8 bits: 28 = 256 colors/color index values
24 bits: 224 colors (Typical RGB Display)
32 bits: 232 colors (Typical RGBA Display)
Different color systems assign different meanings to the available values
INDEXED COLOR WITH LOOK UP TABLE (LUT)
FrameBuffer LUT
0 1
1
RGB Index
011101011101101101 111
100100000101111001 110
000101110100111000 101
010000100101101001 100
011101010100000000 011
010001110101111001 010
100100100110101001 001
111101011101110001 000
WHY USE A “LUT”?
WHY USE A LUT? (cont.)
Display Size
RA
M U
sag
e
LUT
No-LUT
Assuming 24 bit color-depth 1024-entry LUT
Both grow exponentially in display size
LUT has smaller coefficient (Dx * Dy * Color Depth)
(Dx * Dy * LUT Depth) + LUT Size
MONITOR
Three electron beams: R, G, B beams
Electron beam refreshing rate: 60+ frames per second (HZ)
Flicker effect below ~30fps
Non-interlaced display: scanline by scanline, top to bottom, left to right, at stated refresh rate.
Interlaced display: odd rows and even rows are displayed alternately (effectively half non-interlaced rate)
In CRT There are three colored phosphors arranged in triangular groups called triads.
MONITOR
MONITOR
COMPLETE GRAPHICS SUBSYSTEM
GRAPHIC API's (Application Programming Interfaces)
A high level conceptual model of the graphics system, providing:
Object definitions View specification Lighting environment
We will study both sides of the OpenGL API: application programming, and the implementation of the API (graphics pipeline)
Application programs
Graphics API Low-level
graphics system
GRAPHIC API's
Purpose
Avoid system-dependent details
Platform-independent applications
Common graphics languages
2D standard: X-window, GKS, postscript
3D standard: PHIGS, PEX, OpenGL, Direct3D
Hardware-Level: CG, Glide
Common features: object description, attributes, viewing functions, transformations, interactions, controls, etc.
DISPLAY STACK
X Window MSCOM/.NET
Hardware
Hardware-Level Graphics APIs
UNIX Windows
OpenGL, OpenGL ES (WebGL) DirectX
Programming Environment
GRAPHICS PIPELINE Computer Graphic Development Cycle
Scene/Model: Geometric representation of shape information, material and
optical properties, and lighting conditions Model/View transform(s):
Transformation of objects from the scene coordinate system (world coordinate system) to camera coordinate system (viewing coordinate system)
Clipping: Removal of scene elements outside the viewing area
Projection: Mapping from 3D space to 2D viewing plane Rasterization:
Mapping from geometric model to discrete pixel values
Scene/Model Model/View
Transform Rasterization Projection Clipping
COMPUTER GRAPHICS: 1980-1990
Realism comes to computer graphics
smooth shading environment mapping
bump mapping
COMPUTER GRAPHICS: 1980-1990
Special purpose hardware
Silicon Graphics geometry engine
VLSI implementation of graphics pipeline
Industry-based standards
PHIGS
RenderMan
Networked graphics: X Window System
Human-Computer Interface (HCI)
Computer Graphics: 1990-2000
OpenGL API
Completely computer-generated feature-length movies (Toy Story) are successful
New hardware capabilities
Texture mapping
Blending
Accumulation, stencil buffers
Computer Graphics: 2000-
Photorealism
Graphics cards for PCs dominate market
Nvidia, ATI
Game boxes and game players determine direction of market
Computer graphics routine in movie industry: Maya, Lightwave
Programmable pipelines
READING MATERIALS?
Edward Angel, Interactive Computer Graphics: A Top-Down Approach With Shader Based OpenGL. 6th Edition. 2012
Chapter I
QUESTIONS?