oframe / ogl

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

Fix: instancing with gl_InstanceID #152

Closed RAX7 closed 2 years ago

RAX7 commented 2 years ago

The gl.getActiveAttrib method returns some GLSL building variables (e.g. gl_InstanceID, gl_VertexID) as attributes with location == -1, so they need to be filtered out. Also, to make it easier to use istancing draw without any additional attributes, the setInstancedCount method will automatically set the isInstanced flag depending on the given count value.

gordonnl commented 2 years ago

Thanks for your help!