en>Dotdotdotatsignapostrophe |
|
Line 1: |
Line 1: |
| {{distinguish|Phong shading}}
| | It is time to address the slow computer issues whether or not we never recognize how. Just considering the computer is functioning thus slow or keeps freezing up; does not mean to not address the issue and fix it. You may or might not be aware which any computer owner must learn that there are certain aspects that a computer needs to maintain the best performance. The sad truth is that a lot of persons that own a system have no idea which it requires routine maintenance just like their vehicles.<br><br>Most of the reliable firms might offer a full funds back guarantee. This signifies which you have the opportunity to get the cash back in the event you find the registry cleaning has not delivered what you expected.<br><br>So what could you look for whenever you compare registry cleaners. Many of the registry products available now, have extremely similar features. The primary ones that we should be seeking are these.<br><br>Analysis your files plus clean it up regularly. Destroy all unnecessary plus unused files because they only jam a computer system. It can surely enhance the speed of your computer plus be careful that the computer never infected by a virus. Remember always to update the antivirus software every time. If you never employ a computer fairly often, we can take a free antivirus.<br><br>Besides, when you could get a [http://bestregistrycleanerfix.com/system-mechanic system mechanic] which can do the job for you effectively plus quickly, then why not? There is one such system, RegCure which is great and complete. It has qualities that additional cleaners do not have. It is the most recommended registry cleaner today.<br><br>Your program is made plus built for the purpose of helping you accomplish tasks plus not be pestered by windows XP error messages. When there are mistakes, what do we do? Some people pull their hair and cry, while those sane ones have their PC repaired, whilst those truly wise ones research to have the mistakes fixed themselves. No, these errors were not furthermore designed to rob we off the income and time. There are details which you can do to really prevent this from happening.<br><br>You require a choice to automatically delete unwelcome registry keys. This can save you hours of laborious checking by a registry keys. Automatic deletion is a key element when you compare registry products.<br><br>Often the number one means is to read ratings on them and when numerous users remark regarding its efficiency, it's probably to be work. The best part is that there are many top registry products that work; we simply have to take a choose. |
| The '''Phong reflection model''' (also called '''Phong illumination''' or '''Phong lighting''') is an [[Empirical_modelling|empirical model]] of the [[illumination model|local illumination]] of points on a [[surface]]. In [[3D computer graphics]], it is sometimes ambiguously referred to as [[Phong shading]], in particular if the model is used in combination with the interpolation method of the same name and in the context of [[pixel shader]]s or other places where a lighting calculation can be referred to as “[[shading]]”.
| |
| | |
| == History ==
| |
| The Phong reflection model was developed by [[Bui Tuong Phong]] at the [[University of Utah]], who published it in his 1973 Ph.D. dissertation.<ref>Bui Tuong Phong, [http://www.cs.northwestern.edu/~ago820/cs395/Papers/Phong_1975.pdf Illumination for computer generated pictures], Communications of ACM 18 (1975), no. 6, 311–317.</ref><ref>University of Utah School of Computing, http://www.cs.utah.edu/school/history/#phong-ref</ref> It was published in conjunction with a method for interpolating the calculation for each individual [[pixel]] that is rasterized from a polygonal surface model; the interpolation technique is known as [[Phong shading]], even when it is used with a reflection model other than Phong's. Phong's methods were considered radical at the time of their introduction, but have evolved into a baseline shading method for many rendering applications. Phong's methods have proven popular due to their generally efficient use of computation time per rendered pixel.
| |
| | |
| == Description ==
| |
| Phong reflection is an empirical model of local illumination. It describes the way a surface reflects light as a combination of the [[diffuse reflection]] of rough surfaces with the [[specular reflection]] of shiny surfaces. It is based on [[Bui Tuong Phong]]'s informal observation that shiny surfaces have small intense [[specular highlight]]s, while dull surfaces have large highlights that fall off more gradually. The model also includes an ''ambient'' term to account for the small amount of light that is scattered about the entire scene.
| |
| | |
| [[Image:Phong components version 4.png|655px|center|thumb|Visual illustration of the Phong equation: here the light is white, the ambient and diffuse colors are both blue, and the specular color is white, reflecting a small part of the light hitting the surface, but only in very narrow highlights. The intensity of the diffuse component varies with the direction of the surface, and the ambient component is uniform (independent of direction).]]
| |
| | |
| For each light source in the scene, components <math>i_s</math> and <math>i_d</math> are defined as the intensities (often as [[RGB]] values) of the specular and diffuse components of the light sources respectively. A single term <math>i_a</math> controls the ambient lighting; it is sometimes computed as a sum of contributions from all light sources.
| |
| | |
| For each ''material'' in the scene, the following parameters are defined:
| |
| | |
| :<math>k_s</math>, which is a specular reflection constant, the ratio of reflection of the specular term of incoming light,
| |
| :<math>k_d</math>, which is a diffuse reflection constant, the ratio of reflection of the diffuse term of incoming light ([[Lambertian reflectance]]),
| |
| :<math>k_a</math>, which is an ambient reflection constant, the ratio of reflection of the ambient term present in all points in the scene rendered, and
| |
| :<math>\alpha</math>, which is a ''shininess'' constant for this material, which is larger for surfaces that are smoother and more mirror-like. When this constant is large the specular highlight is small.
| |
| | |
| Furthermore, we have
| |
| | |
| :<math>\mathrm{lights}</math>, which is the [[set (mathematics)|set]] of all light sources,
| |
| :<math>\hat{L}_m</math>, which is the direction vector from the point on the surface toward each light source (<math>m</math> specifies the light source),
| |
| :<math>\hat{N}</math>, which is the [[Surface normal|normal]] at this point on the surface,
| |
| :<math>\hat{R}_m</math>, which is the direction that a perfectly reflected ray of light would take from this point on the surface, and
| |
| :<math>\hat{V}</math>, which is the direction pointing towards the viewer (such as a virtual camera).
| |
| | |
| Then the Phong reflection model provides an equation for computing the illumination of each surface point <math>I_p</math>:
| |
| | |
| :<math>I_p = k_a i_a + \sum_\mathrm{m \; \in \; lights} (k_d (\hat{L}_m \cdot \hat{N}) i_{m,d} + k_s (\hat{R}_m \cdot \hat{V})^{\alpha}i_{m,s}).</math>
| |
| <!-- WHICH variable is the index of summation in this sum, running through the list of all members of the set called "lights"?? -->
| |
| <!-- SEVERAL variables depend on the light: direction vectors L and R, intensities i_d and i_s. All of these could be subscripted with a light index if desired, but it's not needed. -->
| |
| | |
| where the direction vector <math>\hat{R}_m</math> is calculated as the [[Specular reflection#Direction of reflection|reflection]] of <math>\hat{L}_m</math> on the surface characterized by the surface normal <math>\hat{N}</math> using:
| |
| | |
| :<math>\hat{R}_m = 2(\hat{L}_m\cdot \hat{N})\hat{N} - \hat{L}_m</math>
| |
| | |
| and the hats indicate that the vectors are [[Unit vector|normalized]]. The diffuse term is not affected by the viewer direction (<math>\hat{V}</math>). The specular term is large only when the viewer direction (<math>\hat{V}</math>) is aligned with the reflection direction <math>\hat{R}_m</math>. Their alignment is measured by the <math>\alpha</math> power of the cosine of the angle between them. The cosine of the angle between the normalized vectors <math>\hat{R}_m</math> and <math>\hat{V}</math> is equal to their [[dot product]]. When <math>\alpha</math> is large, in the case of a nearly mirror-like reflection, the specular highlight will be small, because any viewpoint not aligned with the reflection will have a cosine less than one which rapidly approaches zero when raised to a high power.
| |
| | |
| Although the above formulation is the common way of presenting the Phong reflection model, each term should only be included if the term's dot product is positive. (Additionally, the specular term should only be included if the dot product of the diffuse term is positive.)
| |
| | |
| When the color is represented as [[RGB]] values, as often is the case in [[computer graphics]], this equation is typically modeled separately for R, G and B intensities, allowing different reflections constants <math>k_a,</math> <math>k_d</math> and <math>k_s</math> for the different [[Channel (digital image)|color channels]].
| |
| | |
| === Computationally more efficient alterations ===
| |
| When implementing the Phong reflection model, there are a number of methods for approximating the model, rather than implementing the exact formulas, which can speed up the calculation; for example, the [[Blinn–Phong reflection model]] is a modification of the Phong reflection model, which is more efficient if the viewer and the light source are treated to be at infinity.
| |
| | |
| Another approximation<ref>{{cite web |url=http://dicklyon.com/tech/Graphics/Phong_TR-Lyon.pdf |title=Phong Shading Reformulation for Hardware Renderer Simplification |last1=Lyon |first1=Richard F. |date= August 2, 1993 |work= |publisher= |accessdate=7 March 2011}}</ref> also addresses the computation of the specular term since the calculation of the power term may be computationally expensive. Considering that the specular term should be taken into account only if its dot product is positive, it can be approximated by realizing that
| |
| | |
| :<math>\max(0, \hat{R}_m \cdot \hat{V})^\alpha = \max(0, 1-\lambda)^{\beta \gamma} = \left(\max(0,1-\lambda)^\beta\right)^\gamma \approx \max(0, 1 - \beta \lambda)^\gamma </math>
| |
| | |
| for <math>\lambda = 1 - \hat{R}_m \cdot \hat{V}</math>, for a sufficiently large, fixed integer <math>\gamma</math> (typically 4 will be enough), where <math>\beta = \alpha / \gamma\,</math> is a real number (not necessarily an integer). The value <math>\lambda</math> can be further approximated as <math>\lambda = (\hat{R}_m - \hat{V})\cdot(\hat{R}_m - \hat{V}) / 2</math>; this squared distance between the vectors <math>\hat{R}_m</math> and <math>\hat{V}</math> is much less sensitive to normalization errors in those vectors than is Phong's dot-product-based <math>\lambda = 1 - \hat{R}_m \cdot \hat{V}</math>.
| |
| | |
| The <math>\gamma</math> value can be chosen to be a fixed power of 2, <math>\gamma = 2^n</math> where <math>n</math> is a small integer; then the expression <math>(1 - \beta\lambda)^\gamma</math> can be efficiently calculated by squaring <math>(1 - \beta\lambda)</math> <math>n</math> times. Here the ''shininess'' parameter is <math>\beta</math>, proportional to the original parameter <math>\alpha</math>.
| |
| | |
| This method substitutes a few multiplications for a variable exponentiation, and removes the need for an accurate reciprocal-square-root-based vector normalization.
| |
| | |
| ==Inverse Phong reflection model==
| |
| The Phong reflection model in combination with [[Phong shading]] is an approximation of shading of objects in real life. This means that the Phong equation can relate the shading seen in a [[photograph]] with the surface normals of the visible object. Inverse refers to the wish to estimate the surface normals given a rendered image, natural or computer-made.
| |
| | |
| The Phong reflection model contains many parameters, such as the surface diffuse reflection parameter ([[albedo]]) which may vary within the object. Thus the normals of an object in a photograph can only be determined, by introducing additional information such as the number of lights, light directions and reflection parameters.
| |
| | |
| For example we have a cylindrical object, for instance a finger, and wish to compute the normal <math>N=[N_x, N_z]</math> on a line on the object. We assume only one light, no specular reflection, and uniform known (approximated) reflection parameters. We can then simplify the Phong equation to:
| |
| | |
| :<math>I_p(x) = C_a + C_d (L(x) \cdot N(x)) </math>
| |
| | |
| With <math>C_a</math> a constant equal to the ambient light and <math>C_d</math> a constant equal to the diffusion reflection. We can re-write the equation to:
| |
| | |
| :<math>( I_p(x)- C_a ) / C_d = L(x) \cdot N(x) </math>
| |
| | |
| Which can be rewritten for a line through the cylindrical object as:
| |
| | |
| :<math>( I_p- C_a ) / C_d = L_x N_x + L_z N_z </math>
| |
| | |
| For instance if the light direction is 45 degrees above the object <math>L=[0.71, 0.71]</math> we get two equations with two unknowns.
| |
| | |
| :<math>( I_p- C_a ) / C_d = 0.71 N_x + 0.71 N_z </math>
| |
| :<math>1 = \sqrt{(N_x^2 + N_z^2)}</math>
| |
| | |
| Because of the powers of two in the equation there are two possible solutions for the normal direction. Thus some prior information of the geometry is needed to define the correct normal direction. The normals are directly related to angles of inclination of the line on the object surface. Thus the normals allow the calculation of the relative surface heights of the line on the object using a line integral, if we assume a continuous surface.
| |
| | |
| If the object is not cylindrical, we have three unknown normal values <math>N=[N_x, N_y, N_z]</math>. Then the two equations still allow the normal to rotate around the view vector, thus additional constraints are needed from prior geometric information. For instance in face recognition those geometric constraints can be obtained using [[principal component analysis]] (PCA) on a database of depth-maps of faces, allowing only surface normals solutions which are found in a normal population.<ref>{{cite journal| title=Model-Based Illumination Correction for Face Images in Uncontrolled Scenarios|date=September 2009| author=Boom, B.J. and Spreeuwers, L.J. and Veldhuis, R.N.J.| journal= Lecture Notes in Computer Science| volume=5702| pages=33–40| doi=10.1007/978-3-642-03767-2 | issue=2009| series=Lecture Notes in Computer Science| editor1-last=Jiang| editor1-first=Xiaoyi| editor2-last=Petkov| editor-link2= Nicolai Petkov| editor2-first=Nicolai| isbn=978-3-642-03766-5}}</ref>
| |
| | |
| == Applications ==
| |
| As already implied, the Phong reflection model is often used together with [[Phong shading]] to shade surfaces in [[3D computer graphics]] software. Apart from this, it may also be used for other purposes. For example, it has been used to model the reflection of [[thermal radiation]] from the [[Pioneer program|Pioneer probes]] in an attempt to explain the [[Pioneer anomaly]].<ref>{{cite journal|title=Modelling the reflective thermal contribution to the acceleration of the Pioneer spacecraft|author=F. Francisco, O. Bertolami, P. J. S. Gil, J. Páramos|doi=10.1016/j.asr.2011.10.016|year=2012|journal=Advances in Space Research|volume=49|issue=3|pages=579|arxiv=1103.5222}}</ref>
| |
| | |
| == See also ==
| |
| {{Portal|Computer graphics}}
| |
| * [[List of common shading algorithms]]
| |
| * [[Bidirectional reflectance distribution function]] – another reflection model
| |
| * [[Blinn–Phong shading model]] – alteration of the Phong reflection model to trade precision with computing efficiency
| |
| * [[Phong shading]] – shading technique that interpolates normal vectors rather than intensities
| |
| * [[Specular highlight]] – other specular lighting equations
| |
| | |
| ==External links==
| |
| * [http://michal.is/projects/phong-reflection-model-matlab/ Phong reflection model in Matlab]
| |
| | |
| ==References==
| |
| <references />
| |
| | |
| {{DEFAULTSORT:Phong Reflection Model}}
| |
| [[Category:Computer graphics algorithms]]
| |
| [[Category:Shading]]
| |
| [[Category:Vietnamese inventions]]
| |
It is time to address the slow computer issues whether or not we never recognize how. Just considering the computer is functioning thus slow or keeps freezing up; does not mean to not address the issue and fix it. You may or might not be aware which any computer owner must learn that there are certain aspects that a computer needs to maintain the best performance. The sad truth is that a lot of persons that own a system have no idea which it requires routine maintenance just like their vehicles.
Most of the reliable firms might offer a full funds back guarantee. This signifies which you have the opportunity to get the cash back in the event you find the registry cleaning has not delivered what you expected.
So what could you look for whenever you compare registry cleaners. Many of the registry products available now, have extremely similar features. The primary ones that we should be seeking are these.
Analysis your files plus clean it up regularly. Destroy all unnecessary plus unused files because they only jam a computer system. It can surely enhance the speed of your computer plus be careful that the computer never infected by a virus. Remember always to update the antivirus software every time. If you never employ a computer fairly often, we can take a free antivirus.
Besides, when you could get a system mechanic which can do the job for you effectively plus quickly, then why not? There is one such system, RegCure which is great and complete. It has qualities that additional cleaners do not have. It is the most recommended registry cleaner today.
Your program is made plus built for the purpose of helping you accomplish tasks plus not be pestered by windows XP error messages. When there are mistakes, what do we do? Some people pull their hair and cry, while those sane ones have their PC repaired, whilst those truly wise ones research to have the mistakes fixed themselves. No, these errors were not furthermore designed to rob we off the income and time. There are details which you can do to really prevent this from happening.
You require a choice to automatically delete unwelcome registry keys. This can save you hours of laborious checking by a registry keys. Automatic deletion is a key element when you compare registry products.
Often the number one means is to read ratings on them and when numerous users remark regarding its efficiency, it's probably to be work. The best part is that there are many top registry products that work; we simply have to take a choose.