WebGLSamples / WebGL2Samples

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

Sample showing transform feedback input to instanced draw #148

Closed tsherif closed 7 years ago

tsherif commented 7 years ago

@shrekshao @kenrussell Done :)

kenrussell commented 7 years ago

Very nice. Skimming through this, it looks good, but @shrekshao should fully review and merge it.

shrekshao commented 7 years ago

Hopefully by the end of this week. At the End of semester and whole student career....

On May 1, 2017 7:24 PM, "Ken Russell" notifications@github.com wrote:

Very nice. Skimming through this, it looks good, but @shrekshao https://github.com/shrekshao should fully review and merge it.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/WebGLSamples/WebGL2Samples/pull/148#issuecomment-298458731, or mute the thread https://github.com/notifications/unsubscribe-auth/AEzGrAMSKXBpSqfpooGz2AqRZ4PxZYj4ks5r1mmngaJpZM4NMQ24 .

tsherif commented 7 years ago

Haha, no worries :) Good luck, @shrekshao!

kenrussell commented 7 years ago

Good luck @shrekshao !

shrekshao commented 7 years ago

@tsherif @kenrussell I have a different understanding on how the combining of transform feedback and draw instance should work. Tarek's sample basically applies transform feedback to the geometry vertices buffer (trianglePositions). There are two problems:

So I made some modification based on Tarek's code. It is now a simple agent aimlessly wandering simulation and draw a geometry for each agent instead of rasterize points, which is a better scenario (at least from my point of view) because:

The new pull request is #149 . Here's a preview: