Chapter 6. More on Color and Material 2010.11.08 Presented by Garrett Yeh.

Slides:



Advertisements
Similar presentations
Presented by: Stacy C. Lovell. How do we perceive color? Our eyes contain only 3 types of photosentitive cells tuned to three frequencies Red, Green,
Advertisements

Compositing and Blending Ed Angel Professor Emeritus of Computer Science University of New Mexico 1 E. Angel and D. Shreiner: Interactive Computer Graphics.
CS 352: Computer Graphics Chapter 7: The Rendering Pipeline.
The Buffers and Operations
OpenGL Buffers and Tests Glenn G. Chappell U. of Alaska Fairbanks CS 481/681 Lecture Notes Friday, February 8, 2002.
Framebuffer in OpenGL MAE152 Computer Graphics for Scientists and Engineers Fall 03.
OpenGL Fragment Operations
Graphics Pipeline.
1 Buffers and Processing Fragments 2011 Autumn Animação e Visualização Tridimensional 2011/2012.
RealityEngine Graphics Kurt Akeley Silicon Graphics Computer Systems.
CS 4363/6353 BASIC RENDERING. THE GRAPHICS PIPELINE OVERVIEW Vertex Processing Coordinate transformations Compute color for each vertex Clipping and Primitive.
University of Sulaimani - School of Science - Computer Dept.
Week 7 - Monday.  What did we talk about last time?  Specular shading  Aliasing and antialiasing.
1. 2 Blending: tells you how to specify a blending function that combines color values from a source and a destination. The final effect is that parts.
Compositing and Blending Mohan Sridharan Based on slides created by Edward Angel 1 CS4395: Computer Graphics.
Blending MAE152 Computer Graphics for Engineers and Scientists Fall 03.
Compositing and Blending - Chapter 8 modified by Ray Wisman Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Image Compositing Angel 8.11 Angel: Interactive Computer Graphics5E © Addison-Wesley
Objectives Introduce OpenGL buffers and read/write Introduce OpenGL buffers and read/write Introduce texture mapping Introduce texture mapping Introduce.
Adobe Photoshop CS Design Professional TECHNIQUES INCORPORATING COLOR.
1Notes. 2Atop  The simplest (useful) and most common form of compositing: put one image “atop” another  Image 1 (RGB) on top of image 2 (RGB)  For.
Multisample Antialiasing Kurt Akeley CS248 Lecture 6 11 October 2007
CS248 Midterm Review. CS248 Midterm Mon, November 5, 7-9 pm, Terman Aud Mon, November 5, 3-5 pm, Gates 392 Mostly “short answer” questions Covers through.
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics1 Other Rendering Techniques Types of rendering – Wireframe techniques – Scan-line conversion – Reyes.
02/14/02(c) University of Wisconsin 2002, CS 559 Last Time Filtering Image size reduction –Take the pixel you need in the output –Map it to the input –Place.
CSS552 Final Project Demo Peter Lam Tim Chuang. Problem Statement Our goal is to experiment with different post rendering effects (Cel Shading, Bloom.
09/18/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Bump Mapping Multi-pass algorithms.
9/20/2001CS 638, Fall 2001 Today Finishing Up Reflections More Multi-Pass Algorithms Shadows.
Computer Graphics Inf4/MSc Computer Graphics Lecture 9 Antialiasing, Texture Mapping.
CS 450: COMPUTER GRAPHICS VISIBLE SURFACE DETECTION SPRING 2015 DR. MICHAEL J. REALE.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Tools for Raster Displays CVGLab Goals of the Chapter To describe pixmaps and useful operations on them. To develop tools for copying, scaling, and rotating.
I-1 Steps of Image Generation –Create a model of the objects –Create a model for the illumination of the objects –Create an image (render) the result I.
Lecture 12 Blending, Anti-aliasing, Fog, Display Lists.
Filtering and Color To filter a color image, simply filter each of R,G and B separately Re-scaling and truncating are more difficult to implement: –Adjusting.
OpenGL Blending Akbar Ali
Multi-pass Rendering. © 2002 James K. Hahn, N.H. Baek2 Multi-pass Rendering Repeat: image  Rendering pass  result imageRepeat: image  Rendering pass.
Discrete Techniques Chapter 7 Begun February 22, 2005 Finished April 26, 2005.
Real-Time rendering Chapter 4.Visual Appearance 4.4. Aliasing and antialiasing 4.5. Transparency,alpha,and compositing 4.6. Fog 4.7. Gamma correction
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
CS559: Computer Graphics Lecture 27: Texture Mapping Li Zhang Spring 2008 Many slides from Ravi Ramamoorthi, Columbia Univ, Greg Humphreys, UVA and Rosalee.
09/16/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Environment mapping Light mapping Project Goals for Stage 1.
Compositing and Blending
Computer Graphics Blending CO2409 Computer Graphics Week 14.
Image Manipulation CSC361/661 – Digital Media Spring 2002 Burg/Wong.
UniS CS297 Graphics with Java and OpenGL Blending.
OpenGL Special Effects Jian-Liang Lin 2002 Blending: Alpha Channel Alpha value can be specify by glColor* When blending is enabled, the alpha value is.
11/24/ :45 Graphics II Shadow Maps Reflections Session 5.
Buffers, Compositing and Blending Week 8 David Breen Department of Computer Science Drexel University Based on material from Ed Angel, University of New.
Accumulation-Based Effects Glenn G. Chappell U. of Alaska Fairbanks CS 481/681 Lecture Notes Wednesday, February 4, 2004.
Chapter 4 -- Color1 Color Open GL Chapter 4. Chapter 4 -- Color2 n The goal of almost all OpenGL applications is to draw color pictures in a window on.
9/28/04© University of Wisconsin, CS559 Fall 2004 Last Time Filtering –Box –Bartlett –Gaussian –Edge Detect (High-Pass) –Edge Enhance –How to apply filters.
Compositing and Blending Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
The Framebuffer Hyun-Chul Cho. HyunChul Cho - KUCG -2 Buffer Goal of a graphics program Draw pictures on the screen Screen Rectangular array.
Tan-Chi Ho, CGGM Lab., CSIE of NCTU Pixel Operations and Buffers.
Computer Graphics I, Fall 2008 Compositing and Blending.
Chapter 6. Blending, Antialiasing, Fog, and Polygon Offset Computer Graphics (spring, 2009) School of Computer Science University of Seoul.
CS 4722 Made by Dr. Jeffrey Chastine Modified by Dr. Chao Mei
Week 7 - Monday CS361.
Introduction to Computer Graphics with WebGL
The Graphics Rendering Pipeline
Advanced Graphics Algorithms Ying Zhu Georgia State University
CSc4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University Fog and Transparency.
Angel: Interactive Computer Graphics5E © Addison-Wesley 2009
© University of Wisconsin, CS559 Spring 2004
UMBC Graphics for Games
Blending CSCI 440 textbook section 7.10
Computer Graphics Practical Lesson 7
Chapter X Output Merger.
Computer Graphics Image processing 紀明德
Presentation transcript:

Chapter 6. More on Color and Material Presented by Garrett Yeh

 More on Color, Material, and Lighting (CH6)  Blending  Antialiasing  Fog  Accumulation Buffer

A common technique to make various rendering effects

 Alpha compositing  The process of combining an image with a background to create the appearance of partial transparency.  Range of alpha value – 0.0~1.0  0.0 represents a fully transparent color  1.0 represents a fully opaque color.

 Cf = (Cs * S) + (Cd * D) glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); DrawGround(); glDisable(GL_BLEND);  This function tells OpenGL…  take the source (incoming) color and multiply the color (the RGB values) by the (its) alpha value.  Add this to the result of multiplying the destination color by one minus the alpha value from the source. C f = (C s * S) + ((1-C s) * D) foreground (incoming color) background Ordering: painter’s algorithm

 glBlendFunc(GLenum S, GLenum D);  S and D are the source and destination blending factors

 glBlendEquation(GLenum mode);  glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); ~ gain full control of blending

Use blending to fake “reflection”

glFrontFace(GL_CW); glScalef(1.0f, -1.0f, 1.0f); Clockwise

 All of aliasing is kind of sampling problem  After we down-sample some lines/curves, we may not reconstruct the original version.

 OpenGL uses blending to blend the color of the fragment with the destination color of the pixel and its surrounding pixels.  In essence, pixel colors are smeared slightly to neighboring pixels along the edges of any primitives.

 Use glBlendEquation(GL_FUNC_ADD);  This is a default option. glEnable (…) glHint (…)

 Use “multi-sample” in the initial stage

19 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Blend fog color and rendering result to create fog

Set color of Fog Set range of Fog

Using Accumulation Buffer Foreground blurring Background blurring

 When a camera creates an image, that image does not always represent a single instant of time.  Because of technological constraints or artistic requirements, the image may represent the scene over a period of time.

 1. Render to the color buffer and copy the contents of the color buffer to the accumulation buffer.  Several supported copy operations allow you to repeatedly blend, in different ways.  2. Copy the accumulation buffer back to the color buffer  Display the results with a buffer swap.

 glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH | GLUT_ACCUM);

 glAccum(Glenum op, Glfloat value);  op : Accumulation operation  GL_ACCUM: color buffer add to accum.  GL_LOAD: color buffer replace to accum.  GL_RETURN: accum. to color buffer  GL_MULT:  GL_ADD:  value : a floating-point value used to scale the operation

 A technique to combine some colors to create the effect of other colors  Example: dithering black and white to create gray  glEnable ( GL_DITHER ); glDisable( GL_DITHER ); 50% gray19% gray69% gray

 Image dithering (gray scale)

16-color optimized palette web-safe color palette Original one 256-color with an optimized palette “+” means With dithering