5,321
edits
Line 119: | Line 119: | ||
==Shading== | ==Shading== | ||
{{main | Wikipedia:Shading}} | {{main | Wikipedia:Shading}} | ||
=== | ===Interpolation=== | ||
* Flat shading - color is computed for each face/triangle. | |||
* Gourard shading - color is computed for each vertex and interpolated. | |||
* Phong shading - color is computed for each pixel with the normal vector interpolated from each vertex. | |||
=== | ===Lambert=== | ||
{{main | Wikipedia: Phong | {{main | Wikipedia: Lambertian reflectance}} | ||
See [https://www.scratchapixel.com/lessons/3d-basic-rendering/phong-shader-BRDF scratchapixel phong shader BRDF] | This is a way to model diffuse (matte) materials. | ||
===Phong reflection model=== | |||
{{main | Wikipedia: Phong reflection model}} | |||
See [https://www.scratchapixel.com/lessons/3d-basic-rendering/phong-shader-BRDF scratchapixel phong shader BRDF]. | |||
This is a way to model specular (shiny) materials. | |||
Here, the image is a linear combination of ambient, diffuse, and specular colors. | Here, the image is a linear combination of ambient, diffuse, and specular colors. | ||
Line 137: | Line 142: | ||
The final color is <math>k_{ambient} * ambientColor + k_{diffuse} * (N \cdot L) * diffuseColor + k_{specular} * (R \cdot V)^n * specularColor</math>. | The final color is <math>k_{ambient} * ambientColor + k_{diffuse} * (N \cdot L) * diffuseColor + k_{specular} * (R \cdot V)^n * specularColor</math>. | ||
In | ;Notes | ||
* The diffuse and specular components need to be computed for every visible light source. | |||
===Physically Based=== | |||
See [https://static1.squarespace.com/static/58586fa5ebbd1a60e7d76d3e/t/593a3afa46c3c4a376d779f6/1496988449807/s2012_pbs_disney_brdf_notes_v2.pdf pbs disney brdf notes] and the [http://www.pbr-book.org/ pbr-book] | |||
In frameworks and libraries, these are often refered to as ''standard materials''. | |||
==More Terms== | ==More Terms== |