diff --git a/orx-jvm/orx-dnk3/src/main/kotlin/gltf/GltfScene.kt b/orx-jvm/orx-dnk3/src/main/kotlin/gltf/GltfScene.kt index 9a05997f..eed4a3a9 100644 --- a/orx-jvm/orx-dnk3/src/main/kotlin/gltf/GltfScene.kt +++ b/orx-jvm/orx-dnk3/src/main/kotlin/gltf/GltfScene.kt @@ -9,6 +9,7 @@ import org.openrndr.math.Matrix44 import org.openrndr.math.Quaternion import org.openrndr.math.Vector3 import org.openrndr.math.transforms.transform +import org.openrndr.utils.buffer.MPPBuffer import java.io.File import java.nio.Buffer import java.nio.ByteOrder @@ -92,7 +93,8 @@ fun GltfFile.buildSceneNodes(): GltfSceneData { require(localBufferView.byteLength != null) localBuffer.position(localBufferView.byteOffset) localBuffer.limit(localBufferView.byteOffset + localBufferView.byteLength) - val cb = ColorBuffer.fromBuffer(localBuffer, null) + + val cb = loadImage(MPPBuffer(localBuffer)) cb.generateMipmaps() cb.filter(MinifyingFilter.LINEAR_MIPMAP_LINEAR, MagnifyingFilter.LINEAR) cb.anisotropy = 100.0 diff --git a/orx-jvm/orx-runway/src/main/kotlin/RunwayHttp.kt b/orx-jvm/orx-runway/src/main/kotlin/RunwayHttp.kt index ee9c298a..3acab421 100644 --- a/orx-jvm/orx-runway/src/main/kotlin/RunwayHttp.kt +++ b/orx-jvm/orx-runway/src/main/kotlin/RunwayHttp.kt @@ -22,18 +22,7 @@ fun ColorBuffer.toData(format: ImageFileFormat = ImageFileFormat.JPG): String { return "data:image/jpeg;base64,$base64Data" } -/** - * Construct a color buffer from a base64 data string - */ -fun ColorBuffer.Companion.fromData(data: String): ColorBuffer { - val decoder = Base64.getDecoder() - val commaIndex = data.indexOf(",") - val imageData = decoder.decode(data.drop(commaIndex + 1)) - ByteArrayInputStream(imageData).use { - return ColorBuffer.fromStream(it) - } -} /** * Perform a Runway query