oframe / ogl

Minimal WebGL Library
https://oframe.github.io/ogl/examples
3.77k stars 213 forks source link

Atttribute `id` for geometry #96

Closed hansagames closed 3 years ago

hansagames commented 3 years ago

Hi, in text example I saw this id: { size: 1, data: text.buffers.id }, I tried to check Geometry but didnt saw any usage of it, what is purpose of it ? its some built in attribute ?

thank you

gordonnl commented 3 years ago

Hi @hansagames, id provides a per-character index, for effects that may require it, such as having text that fades in letter-by-letter.

https://github.com/oframe/ogl/blob/8b4533dfb68a099c11682fc5dada69344348003b/src/extras/Text.js#L49-L50