From 30a2b49d5d8269bda12bdaf5c2864b7bf1ecc9ef Mon Sep 17 00:00:00 2001 From: dragbone Date: Mon, 9 Feb 2026 16:01:28 +0100 Subject: [PATCH] Fix issue #213 shader error on webgl --- .../de/fabmax/kool/pipeline/backend/gl/CompiledDrawShader.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kool-core/src/commonMain/kotlin/de/fabmax/kool/pipeline/backend/gl/CompiledDrawShader.kt b/kool-core/src/commonMain/kotlin/de/fabmax/kool/pipeline/backend/gl/CompiledDrawShader.kt index b56d8ed4a..de389c557 100644 --- a/kool-core/src/commonMain/kotlin/de/fabmax/kool/pipeline/backend/gl/CompiledDrawShader.kt +++ b/kool-core/src/commonMain/kotlin/de/fabmax/kool/pipeline/backend/gl/CompiledDrawShader.kt @@ -39,8 +39,9 @@ class CompiledDrawShader(val pipeline: DrawPipeline, program: GlProgram, backend vertexAttrBinder = vertexBinding?.let { binding -> val attrs = binding.vertexAttributes.map { attr -> + val type = if (attr.type.isInt) gl.INT else gl.FLOAT val location = mappedAttribLocations[attr]!! - AttributeBinderItem(location, attr.type.channels, attr.bufferOffset / 4, gl.FLOAT) + AttributeBinderItem(location, attr.type.channels, attr.bufferOffset / 4, type) } AttributeBinder(attrs, binding.strideBytes) }