Setting Water Heightmap

Hi!

I wanted to change the shape of my water waves with that line:

[java]

waterFilter.setHeightTexture((Texture2D) application.getAssetManager().loadTexture(“Textures/waterTest.png”));

[/java]

But nothing is happening at all… If it wouldn’t accept the texture, an exception would have been thrown out right?

But the shape of the waves doesn’t change… what am I doing wrong?

That’s a bug…

the texture param is not set to the material.

Same for the normal map.



I’ve just committed a fix.



If you are not using nightly release you can try to set the texture before attaching the filter to the filterPostPorcessor it should work.

@nehon said:
That's a bug....
the texture param is not set to the material.
Same for the normal map.

I've just committed a fix.

If you are not using nightly release you can try to set the texture before attaching the filter to the filterPostPorcessor it should work.


Ooo... now I have a question. I see a lot of "using nightly" since beta release... is this now a recommended thing? There have been so many updates I'd like to be using... but got in the habit of not using nightly... I do realize that things break on and off still. But I haven't seen anyone say "You shouldn't be using nightly" since Alpha.

I’ve been running nightly for 6 months with no problems - but I’m building it myself so 1. I know when I update (only every few weeks) and 2. I can always roll back if I need to.

@t0neg0d said:
Ooo... now I have a question. I see a lot of "using nightly" since beta release... is this now a recommended thing? There have been so many updates I'd like to be using... but got in the habit of not using nightly... I do realize that things break on and off still. But I haven't seen anyone say "You shouldn't be using nightly" since Alpha.

No, it generally isn't. We push stables when everything works and all parts have been updated. Using nightly can give you all kinds of issues from non-working models due to binary format changes to completely non-working apps because one part of the engine has been changed but other parts have not been updated accordingly.

I was not encouraging him to use nightly, i was giving him a workaround if he doesn’t.

Sorry for not answering quickly.


@nehon said:
you can try to set the texture before attaching the filter to the filterPostPorcessor it should work.

Didn't work :(
@nehon said:
That's a bug....
the texture param is not set to the material.
Same for the normal map.

I've just committed a fix.

If you are not using nightly release [...]

Maybe the next stavle release?
But I guess you don't know when it's gonna be out?
:)

Thanks for answering.

Maybe I’m doing wrong, but setting the shape of the waterFilter via

setHeightmapTexture is still not working after updating to RC2.

Is that fix only commited in the nightly builds?

Test-case:

[java]public class Main extends SimpleApplication {



public static void main(String[] args) {

Main app = new Main();

app.start();

}



@Override

public void simpleInitApp() {

flyCam.setMoveSpeed(200);

rootNode.attachChild(SkyFactory.createSky(assetManager, assetManager.loadTexture(“Textures/west.jpg”),

assetManager.loadTexture(“Textures/east.jpg”),

assetManager.loadTexture(“Textures/north.jpg”),

assetManager.loadTexture(“Textures/south.jpg”),

assetManager.loadTexture(“Textures/top.jpg”),

assetManager.loadTexture(“Textures/bottom.jpg”)));

WaterFilter f = new WaterFilter(rootNode, Vector3f.ZERO);

f.setHeightTexture((Texture2D) assetManager.loadTexture(“Textures/defaultWaterTexture.png”));

FilterPostProcessor fpp = new FilterPostProcessor(assetManager);

fpp.addFilter(f);

viewPort.addProcessor(fpp);

}

}

[/java]