ProjectedGrid and legacy water effects from jME 2

Home Forum Development User Code & Projects ProjectedGrid and legacy water effects from jME 2

This topic contains 29 replies, has 11 voices, and was last updated by  adonkey 8 months, 3 weeks ago.

Viewing 15 posts - 1 through 15 (of 30 total)
  • Author
    Posts
  • #23786
    +7

    Matthias
    7p
    Participant

    Hello,

    has anyone been working on porting the ProjectedGrid and the JME 2 water effects to JME 3?
    Because I have started doing so, more or less as a personal exercise…

    I think it’s time to share the information and show a screenshot that might look familiar :)

    It’s work in progress and there are some features still missing.
    Anyway, feel free to check it out:

    https://github.com/mschell/jme3test

    Greetings,
    Matthias

    #164126

    Normen Hansen
    2792p
    Keymaster

    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.

    #164127

    Matthias
    7p
    Participant

    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?

    #164128

    Normen Hansen
    2792p
    Keymaster

    I mean the solution we will use for jME3.

    #164129

    Lockhead
    18p
    Participant

    Would it be possibly to get the grid information? I mean for buoyancy etc like sloshing objects.

    #164130

    Matthias
    7p
    Participant

    Yes, the grid info is totally separated from the graphics via the HeightGenerateor interface.

    #164131

    Lockhead
    18p
    Participant

    The code was a little bit messy but i got it to work. Looks nice so far. I will try to play later in the week with it.

    #164132

    Matthias
    7p
    Participant

    Agreed, some parts really need a refactoring! I didn’t want to change too much before I got it to work. Thats the reason why…

    #164133
    +5

    Lockhead
    18p
    Participant

    So one week turned into four.
    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.

    http://www.youtube.com/watch?v=JNHo0mEKGJs&list=UUIrZ6NCFuOgilI6_obEz1Fg&index=1&feature=plcp

    #164134

    staugaard
    42p
    Participant

    Very cool :)

    Are you sharing the code or is it TOP SECRET-agent 007-level :)

    #164135

    nehon
    1876p
    Keymaster

    I missed this post very good work @Lockhead !
    This is based on jme2 projected grid water?
    So you ported it to jme3?

    #164136

    Tumaini
    84p
    Member

    Very nice! :)
    What OpenGL extensions will this water require?
    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.

    #164137

    Lockhead
    18p
    Participant

    The credits for porting the water goes to matthias (see the first post). I only utilized his work in my project ;).
    Also he made his work available for all. See the first post.

    #164138

    Matthias
    7p
    Participant

    Cool to see your results, it looks nice :)
    For objects close to the water surface like your ROV, the reflection map shows some annoying artifacts. It used to be like that also in jme2…
    No clue how to fix it without too much effort… When I find time to continue on that project again I will do some research here.

    #198565

    husky
    51p
    Participant

    @matthias
    @Lockhead

    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 20×20 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…

    Video:
    [video]http://www.youtube.com/watch?v=TYOAqB9a-0k&feature=youtu.be[/video]

Viewing 15 posts - 1 through 15 (of 30 total)

You must be logged in to reply to this topic.