Image Formation CS418 Computer Graphics Eric Shaffer http://graphics.cs.illinois.edu/cs418/fa14
Some stuff about the class Grades probably on usual scale: 97 to 93: A 93 to 90: A- 90 to 87: B+ 87 to 83: B 83 to 80: B- etc. won t be any tighter Write the MPs individually unless otherwise instructed Help people on Piazza especially with platform-specific coding questions Book will be posted PDFs
Great Moments in Computer Graphics John Hart asked me to show you this:
Great Moments in Computer Graphics Guardians of the Galaxy Rocket Racoon Academy Award for Physcially-Based Rendering
What drives CG technology Movie Industry Production rendering non-interactive
What drives CG technology Video Game Industry Higher revenue than movies ($13B vs $12.9B in 2013)
What drives CG technology Medical Imaging and Scientific Visualization Imaging one of the biggest advances in medicine Sci Vis allows people to see previously hidden phenomena
What drives CG technology Computer Aided Design Engineering, Architecture, the Maker movement
Computer Vision and Computer Graphics are Inverse Problems Computer Vision Seeks to create digital model of real objects through analyzing images very hard Computer Graphics Seeks to generate images from digital models
World s simplest Ray-tracer Figure from Ray Tracing from the Ground Up by Kevin Suffern
What sub-tasks happened Image processing Rendering Geometric Modeling Animation well, we didn t animate, but we could
Our lighting was not good Any suggested hacks? CG is replete with hacks/clever tricks that mimic principled physical modeling And the way to more realistically light would be
A word about OpenGL Open standard for graphics programming Developed by Silicon Graphics in 1992 Available on most platforms Bindings available for lots of languages It s low level We ll use it in this class.. Windowing typically requires another library e.g. GLUT You can use any programming language or platform you want unless we specify otherwise Discussion sections will go into depth on coding Our examples will usually use C and GLUT
OpenGL in Industry
OpenGL in Industry
OpenGL in Industry
WebGL is not exactly OpenGL Figure from WebGL Programming Guide: Interactive 3D Graphics Programming with WebGL by Matsuda and Lea
WebGL Application Structure Figure from WebGL Programming Guide: Interactive 3D Graphics Programming with WebGL by Matsuda and Lea Your application will generally just have HTML and JavaScript files
WebGL WebGL relatively new (2011) 3D graphics support for web WebGL advantages runs in browser naturally cross-platform don t need to obtain/build other libraries gives you windowing for free easy to publish/share your stuff Disadvantages Depends on how you feel about JavaScript Performance can be tricky
Rayleigh Scattering
Chlorophyll
The Human Eye We perceive the world around us largely through images Pupil controls aperature Varifocal lens controls focus Image projected onto retina
Acuity Angular resolution of retina Snellen ratio: 20/X means you distinguish at 20 feet what the average person distinguishes at X feet. 20/20 = distinguish two points 1 arc minute apart nodal point (optical center) θ = 1 2tan ( h/ 2 d) h d
Focus Simple lens Focal length: f Power: 1/f diopters When d = f = r = 17mm 1m/f = 59 diopters 1 1 1 = + f d r nodal point (optical center) Compound lens cornea: 40 diopters lens: 12 diopters (kids) lose ~ 0.2 diopters/year lens rigid by age 60 1 1 1 = + f f f r =17mm 1 2 d
Chromatic Aberration Refractive index of lens material varies by wavelength Resulting dispersion causes focal plane to vary by color Need 1.5 diopters to focus red and blue to the same depth Never use pure blue (add a bit of red or green to aid in focusing on edges) Warm colors close, cool colors far
Most people see the red, Closer than the blue. Others see the opposite. How about you?
The Human Eye Rods measure brightness whereas cones measure color What we perceive is a heavily processed version of what we physically sense Perceptual nerves process edges and motion before the signal even gets to the brain
The Human Eye Cornea, lens focus light onto Retina from Gray s Anatomy Photoreceptors rods - brightness cones color (red, green, blue) Ganglions nerve cells (X-cells) detect pattern (Y-cells) detect movement
Lateral Inhibition Rods accentuates and exaggerates differences in space and time Eye s internal real-time edge and motion detector Used to detect predators like tigers in the bushes Middle squares same shade of gray -1-1 -1-1 8-1 -1-1 -1
Rods & Cones Blind spot (optic nerve, no rods or cones) rods only Fovea ~0.5º (cones only) Rods measure intensity 80 million Denser away from fovea Astronomers learn to glance off to the side of what they are studying sensitive, shut down in daylight R,G and B cones 5 million total 100K 325K cones/mm 2 in fovea 150 hues Combined 7 million shades Deering s Photon Accurate Model of the Human Retina from SIGGRAPH 2005 rods & cones
The Human Eye
Cone Response 1.0 0.8 log human cone response (normalized) 0.6 0.4 0.2 0 400 450 500 550 600 650 700 wavelength Stockman, MacLeod & Johnson (1993) J. Optical Society of America A, 10, 2491-2521, via Wikipedia
Color Perception L = 31% R + 59% G + 10% B 10% of males are color blind Pay attention to contrast! 400 500 600 700 Eye color space L, R + G B, R G Color space is blackó white, yellowó blue, redó green
Color in Context
Color in Context
The Camera
The Image Plane
Polygonal Models
Pixel Discretization
Raster Rendering For each polygon: Compute illumination Project to image plane Fill in pixels
From Mesh to Pixels Model Coords Model Xform World Coords Viewing Xform Viewing Coords Perspective Distortion Homogeneous Divide Still Clip Coords Clipping Clip Coords Window Coordinates Window to Viewport Viewport Coordinates Setup & Rasterization Pixels Culling Fragments Frag Shading Fragments