Replies: 4 comments 2 replies
-
I am not sure what you're asking. There's an instancing sample here: https://github.com/greggman/twgl.js/blob/master/examples/instancing.html Live here: https://twgljs.org/examples/instancing.html You need to set divisor to 1 on attributes that you want to advance only once per instance. 0 (the default) on attributes you want to advance once per vertex |
Beta Was this translation helpful? Give feedback.
-
Screen-2023-07-25-151549.mp4In the bottom right corner is what I'm trying to achieve (drawing triangles along a path)
I am trying to do the equivalent with twgl in webgl2 mode. (which is shown in large orange viewport with rainbow colors) |
Beta Was this translation helpful? Give feedback.
-
update: it's been solved by switching to latest twgl.js/master/dist/5.x/twgl-full.min.js . I think I had the version in root dist folder which wasn't working. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm trying to instance some triangles like this:
I am able to see the triangle drawn and vertex colors seem to be working, (each vertex has random color which I see rapidly changing if I draw many triangles in sequence)
a_position works for the first position, but stays at the first position instead of using all the positions in stroke.pl.
[.1,.4, -.1, .2, .3, .6, .5,.2, -.5,.3]
I thought divisor might help but it doesn't seem to change anything. Any help appreciated!
Beta Was this translation helpful? Give feedback.
All reactions