jME3 SimpleWater

Hey guys and gals,



even though I am by far no adept with shaders or opengl I had the distinct feeling that water should be easily possible in jme3. So I searched the internet and found this nice little tutorial. With some help of our newly found shader guru Remy we were able to get it partially working.



TODO:

  • correct reflecion
  • correct clipping of reflection an refraction (wrong reflections appearing)
  • better handling of skybox



    Cheers,

    Normen

This is really awesome! :slight_smile:

Looking great as usual :slight_smile:



Is that 238 fps on your MacBook or did you get a new machine?

sbook said:

Is that 238 fps on your MacBook or did you get a new machine?

I am now also proud owner of a MacBook Pro Core i7 so its not my old one :)

The performance hit is not that big, of course the scene needs to be rendered twice but you can lower the resolution of the reflection renderer to 128x128 and it still looks ok because the waves distort it anyway. This was taken with a 512x512 reflection+refraction texture.

nice XD

sp in time will the projected grid stuff get ported or rewritten(noting the desire to not re-use any jme2 code outside the math packages, anyways

mcbeth said:

sp in time will the projected grid stuff get ported or rewritten(noting the desire to not re-use any jme2 code outside the math packages, anyways

Is that a question??

sorry quick hand was in hurry was pretty much asking if the projected grid would be ported into jme3 if at all or recoded





…typing on the run is a hell of thing…sorry again

The water has been improved! It’s now more transparent


I haven't fully tested water yet, but I wonder if there are some optimizations (simplifications) implemented based on  distance to camera? For example, does the water show ripples only near camera or they appear in the whole "water mesh"…

But anyway this is a nice job by Nehon. Next, I believe will be 2d and 3d sky, or paged vegetation :slight_smile:

Kay said:

I haven't fully tested water yet, but I wonder if there are some optimizations (simplifications) implemented based on  distance to camera? For example, does the water show ripples only near camera or they appear in the whole "water mesh"..

Nope, no optimization for the moment. There are still some bugs due to absence of the clipping plane (the bottom of the lake appear in the reflection when camera get far from the water plane), and we have some trouble to compute highlights on the water. But we are working on it

Kay said:

But anyway this is a nice job by Nehon.

Thank you, but don't forget Normen, this is a cooperative work.

Kay said:

Next, I believe will be 2d and 3d sky, or paged vegetation :)

uh what do you mean?

mcbeth said:

sorry quick hand was in hurry was pretty much asking if the projected grid would be ported into jme3 if at all or recoded

I'm not familiar with JME2, so to be honest i don't know about projected grid, but i'll look into it.

Feel free to test in your own baked terrain models, we are eager for feedback :D
Kay said:

I haven't fully tested water yet, but I wonder if there are some optimizations (simplifications) implemented based on  distance to camera? For example, does the water show ripples only near camera or they appear in the whole "water mesh"..
But anyway this is a nice job by Nehon. Next, I believe will be 2d and 3d sky, or paged vegetation :)

The reflection scene is a normally rendered scene, so all LOD etc. methods are also applied to that scene. Also, you can use a competely different scene to render as the reflection that e.g. has less objects or uses LOD more heavily. Furthermore, you can reduce the render output size of the reflection renderer, which also increases performance. The shader itself has no such optimization, as Nehon said.
Cheers,
Normen
nehon said:

Next, I believe will be 2d and 3d sky, or paged vegetation :)
uh what do you mean?

It's like a wishlist of things which will add to jME a lot of cool and sweet features :)

nehon said:

Thank you, but don't forget Normen, this is a cooperative work.

Silly me.. :// Thanks Normen for the nice job!

The water relly looks great now :slight_smile:



To bad I have no use in space for it ^^

I have tried the demo and looks very nice. Good job!