Download presentation
Presentation is loading. Please wait.
Published by吏 强 Modified over 5 years ago
1
ייצוג בעולם 3D ייצוג מצולעים (פוליגונים) צלע קודקוד צלעe0 : {v1,v2}
משולש V1 קודקוד T1 e3 e0 T2 צלעe0 : {v1,v2} T0 V0 משולשT2 :{v0,v1,v2} T3 e1 e2
2
דוגמאות
3
כך זה נראה בגדול
4
נוסיף צבע לעולם
5
ועוד תאורה ...
6
נעדן את התאורה ..
7
עכשיו זה נראה בסדר
8
עם כל השיפורים
9
Illumination and Shading
Reflection Specular Light in How to shade a surface Position (Light/Surface) Orientation (Light/Surface) Characteristics (Light/Surface) Local Illumination Models Individual point and The light source/s Illuminate it Global Illumination Models The light source and The interchange of light between all the surfaces Reflection (diffuse) Internal Reflection Transmitted Light emission
10
Ambient Light Non reflective Self-luminous Illumination equation
I is the resulting intensity Ki is the object’s intrinsic intensity An ambient illumination variable is associated with each point Evaluating the ambient equation <==> Lighting the object. I = k i
11
Diffuse Reflection Point light source
The brightness depends on the angle q between direction to the light L and the surface normal N If the light bean Has cross sectional deferential are dA It intercepts an area dA/cos(q) of the surface. q I = I k cos(q) p d N q N dA dA/cos(q ) S2 S1
12
Combining Shading Models
Series of pictures of sphere illuminated by diffuse reflection model only using different Kd values (0.4, 0.55, 0.7, 0.85,1.0). Series of pictures of sphere illuminated by ambient and diffuse reflection model. Ia = Ib = 1.0, Kd = 0.4 and Ka = {0.0, 0.15, 0.30, 0.45, 0.60}
13
Light Source Attenuation
14
Specular Reflection Phone Illumination N L R V I = Ia Ka +
Developed by Phong Bui-Toung for nonperfect reflection. The model assumes that the maximum specular reflection occurs when is zero and falls off sharply as increases. The rapid falloff is approximated by cos () . V n I = Ia Ka + fatt Id [KdOd cos() +W()cos ()] n Od :Object diffuse factor. W():Factor of specular reflection light
15
Specular Reflection
16
Shading Models for Polygons
We can shade a surface by calculating the surface normal at each visible point and applying the desired model at that point. Constant Flat Shading Applies an illumination model one to determine a singles intensity value that is then used to shade the entire polygon. Interpolated Shading Shading information is linearly interpolated across triangle from illumination values determined at it vertices
17
Polygon Mesh Shading Gouraud Shading extends the concept of interpolated shading applied to individual polygons by interpolating polygon vertex illumination values that take into account the surface being approximated. A vertex intensity is computed by using the vertex normal with any desired shading model. Phong Shading interpolates the surface normal vector, rather than the intensity. Interpolation occurs across a polygon span on a scan line.
18
Interpolated Shading Problems
Polygonal Silhouette Perspective distortion Orientation dependence Problem at shared vertices Inaccurate vertex normal
19
Light & Material in OpenGL
GLfloat lit_mbient[] = {0.2, 0.2, 0.2, 1.0}; GLfloat lit_diffuse[] = {1.0, 1.0, 1.0, 1.0}; GLfloat lit_specular[] = {1.0, 1.0, 1.0, 1.0}; GLfloat lit_position[] = {-2.0, 1.0, 3.0, 1.0}; GLfloat lit_spot_dir[] = {-1.0, -1.0, -1.0}; GLfloat lit_shine[] = {50.0}; glShadeModel(GL_SMOOTH); glEnable(GL_LIGTING); glEnable(GL_LIGHT0); glLightfv(GL_LIGHT0, GL_POSITION, lit_ position); glLightfv(GL_LIGHT0, GL_AMBIENT, lit_ ambient); glLightfv(GL_LIGHT0, GL_DIFFUSE, lit_diffuse); glLightfv(GL_LIGHT0, GL_SPECULAR, lit_specular); glLightfv(GL_LIGHT0, GL_SHININESS, lit_shine);
20
Material
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.