I've been working on a simple game with my son. Supposed to be about a penguin catching fish. I've adapted Craig Reynolds' algorithms for use with ORX (Scroll, actually), and I've posted a video demo of how the schooling looks:
This video is only at 30fps, and for some reason YouTube made it really blurry; it looks pretty smooth in actuality.
The goal was a bit different from the classic Boids:
- Better clumping and alignmentnone
- Fish are more apt to turn in unison, as a groupnone
, this was a matter of turning the 'align' weighting way up compared to the other parameters.
, I implemented a raycast (thanks ROM!) to detect when a wall was coming up, creating a "persistent alignment" state, which is "contagious" for nearby fish. The end effect is that when one fish gets near a wall, most/all of the fish in the school will turn in unison away from the wall.
I can provide code if anyone is interested.
I, for one, would be interested by your code.
What you need next is a nice shader on that water.
There's also this, for the water surface only: http://rotatingcanvas.com/fragment-shader-to-simulate-water-surface-in-libgdx/
The interesting part is the fragment/pixel shader, that's the only one you can modify.
Also, I recently wrote two simple tutorials for orx, both contains shaders if you want to have a look:
However, there's a fixed vertex shader that will be used all the time (if you want to change the vertex shader, you'll probably also want to change the internal vertex format, so you might as well do your own rendering at this point, hooking it with the orxRENDER events).
There's no geometry or tessellation shader either as they don't make sense for quads.
If you want one for a custom object, you need to roll your own rendering for it.