Hello everyone I am currently in a bad position. I m trying to make a river in my game using the Post Process Water but first it doesn’t support polygonal form and second it need to be able to support the Y(height) render. SO if my river is in a small downhill it would render lower and lower to follow the height I ve given to the Polygonal form (Using Vector3f if possible).
Actually I’m asking if anyone did something similar and would like to share it code for the Shaders and an exemple how to set it up ^^. I know i should probably start to learn how to do shader but it quite long and i don’t have the brain set on learn this since I m quite lazy xD.
I would have no idea how to implement this (or even the specifics of the math involved), but, to anyone who does a possible method for doing it could be to transform the entire 3D world by some number of degrees (in ram, not in the final render) such that the angled water plane becomes horizontal in relation to the rotated world. Then, as it renders, refer to the rotated world (or rotate individual parts of it during render to save on memory) rather than the unrotated world.
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.
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).