Instance Property

diffuse

An object that manages the material’s diffuse response to lighting.

Declaration

var diffuse: SCNMaterialProperty { get }

Discussion

Diffuse shading describes the amount and color of light reflected equally in all directions from each point on the material’s surface. The diffuse color of a pixel is independent of the point of view, so it can be thought of as a material’s “base” color or texture.

By default, the diffuse property’s contents object is a white color. The figure below shows the effect of setting the diffuse property’s contents to a texture image on a material whose other properties have default contents.

Figure 1

Adding a diffuse texture to a material

The material’s lightingModel property determines the formula SceneKit uses to combine its diffuse color and other visual properties with lights and other contents in a scene to produce the final color for each rendered pixel in the rendered scene. For details, see Lighting Models.

See Also

Visual Properties for Physically Based Shading

var metalness: SCNMaterialProperty

An object that provides color values to determine how metallic the material’s surface appears.

var roughness: SCNMaterialProperty

An object that provides color values to determine the apparent smoothness of the surface.