Rice COMP 360 - Color and Intensity

Unformatted text preview:

Lecture 16: Color and Intensityand he made him a coat of many colours. Genesis 37:31. IntroductionTo display a picture using Computer Graphics, we need to compute the color and intensity of the light at each point in the picture. The purpose of this lecture is to explain how to represent color and intensity numerically and then to develop illumination models that allow us to compute the color and intensity at each point once we know the color, location, and intensity of the light sources and the physical characteristics of the objects in the scene.2. The RGB Color ModelColor forms a 3-dimensional vector space. The three primary colors -- red, green, and blue -- are a basis for this vector space: every color can be represented as a linear combination of red, green, and blue.The unit cube is often used to represent color space (see Figure 1). Black is located at one corner of the cube usually associated with the origin of the coordinate system, and the three primary colors are placed along the three orthogonal axes. Intensity varies along the edges of the cube, with the full intensity of each primary color corresponding to a unit distance along the associated edge. Every combination of color and intensity is then represented by some linear combination of red, green, and blue, where the coefficients of each primary color lie between zero and one. Thus for each color c there is a unique set of coordinates € (r,g,b) inside the unit cube that represents the color c. The numerical values € (r,g,b) represent intensities: the higher the value of r or g or b, the greater the contribution of red or green or blue to the color c. This model is known as the RGB color model and is one of the most common color models in Computer Graphics.€ •€ •€ •€ •€ •€ •€ •€ black€ white€ red€ green€ blue€ •€ cyan€ magenta€ yellowFigure 1: The RGB color cube. Every color and intensity is represented by a linear combination of the red, green, and blue, where the coefficients of each primary color lie between zero and one.Pairs of primary colors combine to form colors complementary to the missing primary. Thus red+green=yellow, which is the color complementary to blue. Similarly, blue+green=cyan, which is the color complementary to red, and blue+red=magenta, which is the color complementary to green. Combining all three primaries at full intensity yields white=red+green+blue, which lies at the corner of the cube diagonally opposite to black. Shades of gray are represented along the diagonal of the cube joining black to white.In the remainder of this lecture we shall develop illumination models. These illumination models allow us to render a scene by computing the € (r,g,b) color intensities for each surface point once we know the light sources and the physical characteristics of the objects in the scene. We shall consider three illumination models: ambient light, diffuse reflections, and specular highlights.3. Ambient LightAmbient light is light that is reflected into a scene off outside surfaces. For example, sunlight that enters a room through a window by bouncing off nearby buildings is ambient light. Ambient light softens harsh shadows generated by point light sources. Thus ambient light helps to make scenes rendered by Computer Graphics appear more natural.Typically we assume that the intensity € Ia of the ambient light in a scene is a constant. What we need to compute is the intensity I of the ambient light reflected to a viewer from each surface point in the scene. The formula for this intensity I is simply€ I = kaIa, (3.1)where € 0 ≤ ka≤1 is the ambient reflection coefficient. The ambient reflection coefficient € ka is a property of the color and material of the surface, which can be determined experimentally or simply set by the programmer. Notice that the intensity I is independent of the position of the viewer.Equation (3.1) is really three equations, one for each primary color red, green, and blue. If we set € Ia= (Iar,Iag,Iab) and € ka= (kar,kag,kab), where € (Iar,Iag,Iab) are the ambient intensities for red, green and blue, and € (kar,kag,kab) are the ambient reflection coefficients for red, green, and blue, then Equation (3.1) becomes€ I = (r,g,b) = (karIar,kagIag,kabIab). (3.2)Notice that if the ambient light is white, then € Ia= (1,1,1), so the color of the light reflected from a surface is the color of the surface. However, if the color of the ambient light is blue and the color of the surface is red, then € Ia= (0,0,1) and € ka= (kar,0,0), so € I = (r,g,b) = (0,0,0) and the color perceived by the viewer is black.24. Diffuse ReflectionDiffuse light is light reflected off dull surfaces like cloth. Light dispersed from dull surfaces is reflected from each point by the same amount in all directions. Thus the intensity of the reflected light is independent of the position of the viewer. Here we shall compute the diffuse light reflected off a dull surface from a point light source.Let € Ip be the intensity of the point light source. We need to compute the intensity I of the diffuse light reflected to a viewer from each point on a dull surface. Let L be the unit vector from the point on the surface to the point light source, and let N be the outward pointing unit normal at the point on the surface (see Figure 2). Then the formula for the diffuse intensity I is simply € I = kd(L • N)Ip, (4.1)where € 0 ≤ kd≤1 is the diffuse reflection coefficient. The diffuse reflection coefficient € kd, like the ambient reflection coefficient € ka, is a property of the color and material of the surface, which can be determined experimentally or simply set by the programmer.θNLSurfaceFigure 2: The unit normal vector N to a point on the surface, and a unit vector L pointing in the direction of a point light source.Equation (4.1) is a consequence of Lambert’s Law. Consider a point light source far away from a small surface facet (see Figure 3). Let € Ifacet denote the intensity of light on the facet, and let € Isource denote the intensity of the light source. Then € Ifacet=LightUnit Area=Beam Cross SectionFacet Area× Isource.But we can see from Figure 3 that€ Beam Cross SectionFacet Area= cos(θ),where


View Full Document

Rice COMP 360 - Color and Intensity

Documents in this Course
Radiosity

Radiosity

42 pages

Radiosity

Radiosity

22 pages

Load more
Download Color and Intensity
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Color and Intensity and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Color and Intensity 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?