How to set the 'size' of the waterFilter

Wow :o

yes, WOW.



but i have other question.

its somehow about topic, i have a bowl with water.



is there a material that simulate water in containers? if not, would it be hard to add into JME?



i seen there was something like that in JME2



example from skyrim:

http://i.imgur.com/YEdev.jpg

Look at TestSimpleWater, it’s basically a water material applied to a quad. It’s cheaper that the post water and you can apply it on any geometry.

4 Likes

:open_mouth: this, this is perfect, thanks!

Yeah nehon,



thx for finally adding to the core!!!



But now I start to flame: Is it also possible to have a rectangular area instead of a circle? I have my worldmap which is like a chessboard and I want to have the water stretched all over it, but not beyond…

:facepalm: just a moment ago we were joking about the instant requests about square areas in the core chat :roll:

like nehon said, for simple small water surfaces the simple water is much better suited.

Hehe yeah, but there is more to it. I want to have a sea with waves and everything, shore and so on. Maybe you remember my Total War clone. Right now, the water does not stop at the edge of the world map but extends to infinity… which looks weird :wink:

thanks nehon



but is there no way to appy water material via SceneComposer? the only way is to do it via code?(waterProcessor.getMaterial())

i think it would be easier if water would be like material Definition to make material and to set it in SceneComposer :slight_smile:

water.setShapeType(WaterFilter.AreaShape.Square);

http://i.imgur.com/Or68I.jpg

3 Likes

Nice Nehon, finally :slight_smile:



And thanks for the different heights! That I needed :slight_smile:

Oh time to update jme again, thank nehon :wink:

Yeah, thanks nehon. I really appreciate it!!! :slight_smile:

From this:







to this:









Ahhhhhh, waaaayyy better :wink:

2 Likes
@nehon said:
ok it's finally in the core.


Nightly broke it, this fixed the TestPostWater but I have no clue if it is the right way to fix it, I just took a shot in the dark there :)

[patch]
# This patch file was generated by NetBeans IDE
Index: WaterFilter.java
--- WaterFilter.java Base (BASE)
+++ WaterFilter.java Locally Modified (Based On LOCAL)
@@ -196,6 +196,7 @@
renderManager.setHandleTranslucentBucket(true);
rtb = false;
}
+ reflectionScene.updateGeometricState();
renderManager.renderViewPort(reflectionView, tpf);
if (!rtb) {
renderManager.setHandleTranslucentBucket(false);
[/patch]

I can confirm that bug, get it with latest nightly as well.



About the fix not sure, guess its correct but lets better wait for nehons opinion.

Mhh it works for me.



What is broken exactly? The reflectionScene is assumed to be updated outside of the Filter, usually you just feed it with the rootNode.

2 Likes

With revision



i get in TestMultiPostWater

Code:
SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main] java.lang.IllegalStateException: Scene graph is not properly updated for rendering. State was changed after rootNode.updateGeometricState() call. Make sure you do not modify the scene from another thread! Problem spatial name: Root Node at com.jme3.scene.Spatial.checkCulling(Spatial.java:260) at com.jme3.renderer.RenderManager.renderScene(RenderManager.java:636) at com.jme3.renderer.RenderManager.renderViewPort(RenderManager.java:965) at com.jme3.water.WaterFilter.preFrame(WaterFilter.java:199) at com.jme3.post.FilterPostProcessor.preFrame(FilterPostProcessor.java:328) at com.jme3.renderer.RenderManager.renderViewPort(RenderManager.java:948) at com.jme3.renderer.RenderManager.render(RenderManager.java:1016) at com.jme3.app.SimpleApplication.update(SimpleApplication.java:253) at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:151) at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:184) at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:228) at java.lang.Thread.run(Thread.java:722)

Like the Phoenix I get the “State was changed after rootNode.updateGeometricState() call.” for my own code and also the test cases.

Updated from svn to version 9574 this morning, right click the “TestPostWater” and select run file. Is this not the right way?



[patch]SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]

java.lang.IllegalStateException: Scene graph is not properly updated for rendering.

State was changed after rootNode.updateGeometricState() call.

Make sure you do not modify the scene from another thread!

Problem spatial name: Root Node

at com.jme3.scene.Spatial.checkCulling(Spatial.java:260)

at com.jme3.renderer.RenderManager.renderScene(RenderManager.java:636)

at com.jme3.renderer.RenderManager.renderViewPort(RenderManager.java:965)

at com.jme3.water.WaterFilter.preFrame(WaterFilter.java:199)

at com.jme3.post.FilterPostProcessor.preFrame(FilterPostProcessor.java:328)[/patch]

Ok, after a clean and build I have he issue.



I guess revision, http://code.google.com/p/jmonkeyengine/source/detail?r=9568 has something to do with it.

I’ll check that out.

2 Likes

Ah, this is awesome :smiley: