diff --git a/src/core/shader/extractAttributesFromSrc.js b/src/core/shader/extractAttributesFromSrc.js index c5a3672..8e6518b 100644 --- a/src/core/shader/extractAttributesFromSrc.js +++ b/src/core/shader/extractAttributesFromSrc.js @@ -29,9 +29,11 @@ if (line.indexOf('attribute') > -1) { const splitLine = line.split(' '); - const type = splitLine[1]; + const startIndex = splitLine.indexOf('attribute'); - let name = splitLine[2]; + const type = splitLine[startIndex+1]; + + let name = splitLine[startIndex + 2]; let size = 1; if (name.indexOf('[') > -1) @@ -66,7 +68,7 @@ attrib.location = i; attributes[attrib.name] = attrib; } - + return attributes; }