Alright so this is no simple mater, then the first solution would be to make a geometry instead? I don’t mind not having reflection since reflection are quite rare in river water(since they move a lot it become blurry). But if it s too hard to implements any kind of post process because of the angle, I will use a plane with animated texture instead.
If it were me… I’d have a strip of triangles form the river’s course where the y texture coordinates roughly maps to distance along the river and x maps to river width. Then animate a texture by offsetting y by time. The texture would include bump/normal maps, etc… The nice thing about this approach is that if you are clever modeler then you can tweak the texture coordinates to have the texture widen and narrow, flow faster in some places than others, etc… By adding a little variance in the y texture offsets you can even avoid having it look like just a texture sliding along a river.
Particle effects are also good anywhere you’d want to simulate rougher water like around rocks and stuff,
For really advanced effects, tessellate the river triangles more and animate some of the vertexes up and down a bit.
Or maybe just use a cubemap for the reflection (like in Serious Sam 2). Of course, add some normal perturbance and maybe some other shader tricks. The tesselated and animated triangles can look interesting - I’ve seen such things 10 years before on hardware that today is ancient. Since vertex operations are almost free and number of triangles is only still relevant on mobile devices, this might look quite good. One might also try to (mis)use parallax mapping or one of its advanced modifications…
@John01dav: i ve though of doing a particle water system, but particle are expensive.
@pspeed: I cant do the model my self, it will be procedural depending on the map generated. I m not quite good with generating triangle my self but the the idea I had in mind was this one(but the moving pixel for animation). I could probably give it a try again and base the bump map of the texture under the river.
@Ogli: I will ignore the reflection map for now, since it quite a lot of work. But as you said I will give a try on making @pspeed idea for now!
IF it turn out correctly and the engine it self need a river system i will do my best to make the code portable and easy to implement for future user. It will be implemented to work with the actual Heighmap.
@androlo did a bunch of work on a flowing river system thing, I only have vague memories of it as it wasn’t something I needed, so I never looked deep into his work much, possible a good starting point.
I don’t mean to be a buzz kill, but a) that looks like total ass, and b) this kind of tech is next to useless in a game dev environment, unless one is making a fluid sim based game like Mercury Meltdown or the countless falling sand style games.
My first goal would have been particle fluid with physic but the problem here is it need to be started else my river wont have fluid until the fluid arrive each time you move in the infinite map.
But i have to say I m quite impress with the result you got. It should probably be part of the engine!
You could also try to use the “projected grid water” from jME 2. Someone had ported it to jME 3. That water uses a dynamic mesh and you can define height points. Problem with the reflection map remains (again, I recommend a cubemap - a pre-rendered one which captures the overall characteristics of the scene).
Intel Xeon CPU E5-1650 v2 3.50GHz (6 cores), 32GB RAM and an AMD FirePro W9100 GPU with 16VRAM
(that’s my work station, my computer at home is far not so good )