Skip to content

Replacing textures for loaded models #110

Discussion options

You must be logged in to vote

You shouldn't use the old TextureBuilder anymore but the Filament Texture.Builder() one directly.
You can have a look at

/**
* Based on the [com.google.android.filament.textured.loadTexture]
*/
object TextureLoader {
suspend fun loadImageTexture(
context: Context,
lifecycle: Lifecycle,
imageFileLocation: String,
type: TextureType = TextureType.COLOR
): Texture? =
context.useFileBufferNotNull(imageFileLocation) { buffer ->
withContext(Dispatchers.Main) {
createImageTexture(lifecycle, buffer, type)

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@m-paunovic-vegait
Comment options

Comment options

You must be logged in to vote
1 reply
@m-paunovic-vegait
Comment options

Answer selected by m-paunovic-vegait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants