Skip to content

Instantly share code, notes, and snippets.

@yakivmospan
Last active November 19, 2018 15:32
Show Gist options
  • Save yakivmospan/4cd9a884a3570ef842748ef6f80684f1 to your computer and use it in GitHub Desktop.
Save yakivmospan/4cd9a884a3570ef842748ef6f80684f1 to your computer and use it in GitHub Desktop.
val fakeObject = ModelRenderable.builder()
.setSource(context, R.raw.fakeObject)
.build()
val defaultMaterial = fakeObject.get().material
val realObject = ModelRenderable.builder()
.setSource(context, URI("object_name"))
.build()
val realObjectMaterial = defaultMaterial.copy()apply{
setTexture("baseColorMap", diffuse)
setTexture("metallicMap", metallic)
setTexture("normalMap", normal)
setTexture("roughnessMap", roughness)
}
realObject.get().material = realObjectMaterial
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment