PhongShading
✖
PhongShading
is a three‐dimensional graphics directive that specifies that faces of polygons and other filled graphics objects are to be drawn to reflect as a smooth surface using a normal‐vector interpolation shading.
Details

- PhongShading is also known as per‐pixel shading and Phong interpolation.
- PhongShading is typically used to achieve smooth lighting on polygon surfaces.
- The final colors are computed from the interpolation of the surface normals across polygons and the luminosity of the color resulting from standard shading.
- PhongShading[d,s,a] specifies that the diffuse light on a 3D surface should be attenuated by a factor d, the specular light by s and the ambient light by a.
- PhongShading[] is effectively equivalent to PhongShading[1,1,1].
- The setting Lighting"Accent" uses a directional light and faithfully reproduces colors on the surface.
- The basic shading models FlatShading, GouraudShading and PhongShading compared:


Examples
open allclose allBasic Examples (3)Summary of the most common use cases
Apply PhongShading to the unit sphere:

https://wolfram.com/xid/0n4m2lsvoc6-9bobg8

Style a plot with PhongShading:

https://wolfram.com/xid/0n4m2lsvoc6-bxvywi

Draw a 3D model with PhongShading:

https://wolfram.com/xid/0n4m2lsvoc6-gizs7p

Scope (14)Survey of the scope of standard use cases
Basic Uses (5)
Apply Phong shading to a graphics primitive:

https://wolfram.com/xid/0n4m2lsvoc6-on7trh

Apply Phong shading to a plot:

https://wolfram.com/xid/0n4m2lsvoc6-6c6wq4

Apply Phong shading to a chart:

https://wolfram.com/xid/0n4m2lsvoc6-nsf6pc

Apply Phong shading to a 3D object:

https://wolfram.com/xid/0n4m2lsvoc6-lnumvr


https://wolfram.com/xid/0n4m2lsvoc6-gjv4nh

Specification (5)
PhongShading with no arguments uses similar calculations as the default system shader:

https://wolfram.com/xid/0n4m2lsvoc6-kpmf1a

Attenuate all light from the surface by a scaler value:

https://wolfram.com/xid/0n4m2lsvoc6-xzz4wt

This is equivalent to specifying each attenuation factor explicitly:

https://wolfram.com/xid/0n4m2lsvoc6-ku8v9

Attenuate the diffuse light, setting other attenuation factors to zero:

https://wolfram.com/xid/0n4m2lsvoc6-l09epq

Attenuate the specular light, setting other attenuation factors to zero:

https://wolfram.com/xid/0n4m2lsvoc6-3hxlmt

Attenuate the ambient light, setting other attenuation factors to zero:

https://wolfram.com/xid/0n4m2lsvoc6-ku2ok

Lighting (4)
PhongShading works with all types of lights:

https://wolfram.com/xid/0n4m2lsvoc6-435h8


https://wolfram.com/xid/0n4m2lsvoc6-02vn70

The specular percentage only applies if the Specularity directive has been specified:

https://wolfram.com/xid/0n4m2lsvoc6-mycu27

The ambient percentage only applies if an AmbientLight is has been specified:

https://wolfram.com/xid/0n4m2lsvoc6-849paw

Applications (2)Sample problems that can be solved with this function
Basic Applications (2)
Show interior normals interpolated from vertex normals:

https://wolfram.com/xid/0n4m2lsvoc6-k488n3
Triangle with identical vertex normals:

https://wolfram.com/xid/0n4m2lsvoc6-wzfz5y

Triangle with a different normal at each vertex:

https://wolfram.com/xid/0n4m2lsvoc6-gq04cf

PhongShading can be separated into individual components for diffuse, specular and ambient lighting:

https://wolfram.com/xid/0n4m2lsvoc6-rk9ttp

These components are summed to achieve the final result:

https://wolfram.com/xid/0n4m2lsvoc6-mho5ti

PhongShading performs the individual calculations and summation by default:

https://wolfram.com/xid/0n4m2lsvoc6-fyqhyr

Properties & Relations (4)Properties of the function, and connections to other functions
PhongShading uses VertexNormals if specified:

https://wolfram.com/xid/0n4m2lsvoc6-4ib8zo

Specify FaceForm with PhongShading:

https://wolfram.com/xid/0n4m2lsvoc6-xdotqs

GouraudShading approximates the PhongShading when the screen size and shade variance across polygons are small:

https://wolfram.com/xid/0n4m2lsvoc6-wzw9fd

PhongShading typically has a smaller specular highlight than the default system shader:

https://wolfram.com/xid/0n4m2lsvoc6-yii2i1

Wolfram Research (2022), PhongShading, Wolfram Language function, https://reference.wolfram.com/language/ref/PhongShading.html.
Text
Wolfram Research (2022), PhongShading, Wolfram Language function, https://reference.wolfram.com/language/ref/PhongShading.html.
Wolfram Research (2022), PhongShading, Wolfram Language function, https://reference.wolfram.com/language/ref/PhongShading.html.
CMS
Wolfram Language. 2022. "PhongShading." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/PhongShading.html.
Wolfram Language. 2022. "PhongShading." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/PhongShading.html.
APA
Wolfram Language. (2022). PhongShading. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PhongShading.html
Wolfram Language. (2022). PhongShading. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PhongShading.html
BibTeX
@misc{reference.wolfram_2025_phongshading, author="Wolfram Research", title="{PhongShading}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/PhongShading.html}", note=[Accessed: 21-April-2025
]}
BibLaTeX
@online{reference.wolfram_2025_phongshading, organization={Wolfram Research}, title={PhongShading}, year={2022}, url={https://reference.wolfram.com/language/ref/PhongShading.html}, note=[Accessed: 21-April-2025
]}