let plane = SCNPlane() self.plane = plane let planeNode = SCNNode(geometry: plane) scene.rootNode.addChildNode(planeNode) planeNode.scale = SCNVector3(4, 4, 4) let surfaceShader = """ auto diffuse = _surface.diffuse; diffuse = vec4(diffuse.r, 0, 0, 1); _surface.diffuse = diffuse; """ plane.firstMaterial!.shaderModifiers = [ SCNShaderModifierEntryPoint.surface: surfaceShader]