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)
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.
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
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
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