How to add a standard lighting model to a SCNProgram

Oscar de la Hera
AR Tips And Tricks
Published in
1 min readNov 19, 2018
Every post needs an image.

Standard lighting models are listed here.

let program = SCNProgram()let programType:String = "YOUR_SHADER_PREFIX"program.fragmentFunctionName = programType+"SurfaceFragment"program.vertexFunctionName = programType+"VertexShader"let shaderMaterial = SCNMaterial();shaderMaterial.program = program;shaderMaterial.lightingModel = .lambert;

Key addition being:

shaderMaterial.lightingModel = .lambert;

O

--

--

AR Tips And Tricks
AR Tips And Tricks

Published in AR Tips And Tricks

A place where I document my findings and make them available to the masses. For all blog posts go to www.oscardelahera.com/blog

Oscar de la Hera
Oscar de la Hera

Written by Oscar de la Hera

Oscar is an award-winning Spanish Inventor whose work impacts lives through brands that include Nike, MoMA and Samsung.