Created
November 30, 2015 22:17
-
-
Save fluidpixel/d33dbff74ad8c74fe1b5 to your computer and use it in GitHub Desktop.
Add light map to materials imported from Collada
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sceneView.scene!.rootNode.enumerateChildNodesUsingBlock (){ | |
node, stop in | |
if let materials = node.geometry?.materials { | |
for material in materials { | |
//Blender export doesn't support multiple textures per object, so we add our lightmap to the 2nd UV channel here | |
let image = SCNImage(named:"WorldLightmap") | |
material.multiply.contents = image | |
material.multiply.intensity = 0.7 | |
material.multiply.mappingChannel = 1 | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment