greggman / twgl.js

A Tiny WebGL helper Library
http://twgljs.org
MIT License
2.61k stars 258 forks source link

Dynamically changing attribute values, does it require to create bufferinfo everytime #199

Closed Vadi closed 2 years ago

Vadi commented 2 years ago

Newbie to twgl here, in my use case position attribute changes let's say based on user mouse down event. For every click, we use mouse xy to set position attribute. Position is a vec2 attribute.

Currently i create bufferinfo once with initial xy values. How do i go about setting values after mouse clicks. Should be recreating buffer info?

All examples don't change position attributes

Any help is greatly appreciated