WebGLSamples / WebGL2Samples

Short and easy to understand samples demonstrating WebGL 2 features
Other
1.01k stars 143 forks source link

Transform feedback objects #153

Closed tsherif closed 7 years ago

tsherif commented 7 years ago

See the wiki entry here: https://www.khronos.org/opengl/wiki/Transform_Feedback#Feedback_objects

Transform feedback objects capture the state of TRANSFORM_FEEDBACK_BUFFER bindings, so when they are set up correctly, you don't have to bind the individual buffers (kind of like an output version of a VAO).

This update moves the setup of transform feedback objects for relevant samples into the parts of the code that set up VAOs, and then simply bind/unbind the transform feedback objects when drawing (rather than binding each individual output buffer).

shrekshao commented 7 years ago

Thanks @tsherif. New stuff learnt. But there's a problem in current version's code: neither of xform seaparated 2 (particle system) and transform instanced sample work. Seems like buffer ping pong is wrong so the simulation stuck at the first frame? Will review in details later.

tsherif commented 7 years ago

Hmm... they're both working for me in Firefox and Chrome on Ubuntu 16.04/Quadro M1000. I'll try it out on some of my other machines.

tsherif commented 7 years ago

@shrekshao (cc:@kenrussell) This is an ANGLE bug. I saw the issue in both Firefox and Chrome on Windows, then when I disabled the ANGLE backend it worked fine in both. I'll put together a small example when I have some time and report.

tsherif commented 7 years ago

Bug reported here: https://bugs.chromium.org/p/angleproject/issues/detail?id=2051

tsherif commented 7 years ago

@shrekshao I updated those two examples with workarounds for the ANGLE bug. I think it's worth having the samples structured around how things should work, with the workarounds clearly marked as such so they can be easily removed later. What do you think?

shrekshao commented 7 years ago

@tsherif . Agree. Thanks for the great work. Will review later and merge.