Hehe cool. Nobody was working on this as the water has pretty much been replaced with post process water really… The projected grid has been worked on in some way but the “real” solution will involve the lighting shader.
Sure, I thought so! I especially missed the jme 2 water effects, as they are more suitale for offshore scenes and have a simple interface to the wave height field.
But I will definitly check out how you can get similar results out of the awesome post process filter…
That will naturally be the next thing to go from here.
@normen said:
The projected grid has been worked on in some way but the "real" solution will involve the lighting shader.
Sorry, I didn't quite get what you mean. You can apply any material to the projected grid in the code here. What is not "real" then?
I made a little video and combined your waves with my buoyancy. Now the object reacts to the wave height. Please ignore the occasional flickering and the not so good reflections. Never found good params.
I can’t seem to use the other water effects with my Intel card (reporting as OpenGL 2.1 but probably missing some features), so I’d be very interested to know what this effect requires, as the water effects in jME2 worked well with it.
I am using the ProjectedGrid as well in my ship simulator and until now, without problems. However, since my simulator is getting some more features, I start to notice some issues:
I have created a ProjectedGrid with sizeX=100 units and sizeY=100 units (my ship is around 1 unit). As soon as I start to come closer to the edges, flickering occurs and the waves are getting ‘less detailed’. Also, white areas will occur in the waves (as if there is no water at all, but the ship keeps bouncing as it should on the waves, so the waves are still calculated, just not displayed properly).
Below you can see this in a video I made. I decreased the size of the grid to 20x20 units to speed up the process (it makes the waves ugly, but this is just for testing)and I have cut some parts out of the video. In the HUD you can see in red the travelled distance (in world units). In the last part, I disconnected the camera from the ship (it is connected with a CameraNode and switched back to the FlyCam: Same artefacts.
In the video:
00:00 - 00:20 --> Some flickering from the beginning. This has to do with the fact that I reduced the sice of the grid to only 20 units.
00:20 - 00:43 --> Little bit more flickering
00:43 - 01:17 --> Strange visual artefacts at guns (barrels showing through), some white areas alongside the edge of the screen (01:08 and further, travelled 400 units).
01:17 - 01:50–> Ship and guns are flickering as well. More white areas, also at bottom of screen.
01:50 - end --> Disconnected camera to show same results. Ship seems to rol normally on the waves, but all parts are flickering.
Strange thing is that also the parts of the ship (pay attention to the barrels of the guns) show weird behaviour, so not only the water. This makes me wonder if it has to do with the regular camera and not with the ProjectedGrid? I see the same issues when I set the wave height to 0 (I made several sea states (from no waves to a big storm).
Any idea what can cause these artefacts? I have tried to understand what exactly the code is doing, but the only thing I have managed so far is to get the ProjectedGrid working and to create different sea stated during runtime. Understanding the process of creating the actual waves and shaders is one bridge too far…
Yes, I am experiencing those effects as well lately. I have been playing around with the grid for my simulator a long time already and I am SURE it did not show this behaviour in the past (say about one year ago).
I have not payed too much attention to it, but could it be possible it is due to some changes in the engine?
On June 2012 it was working okay, see my first buoyancy attempt:
First I thought it might have to do with my new graphics card GTX 580 but now you are experiencing similar issues, I start to doubt that. I will see if I still have that old code and if I find it I will run it again, see what it does.
Yeah. Even the reflection is working fine. Could it be that we changed some parameters? I am working on implementing the gerstner wave method into JME so that will ultimately replace this water effect.