im tring to create water usinf a FilterPostProcessor object.
but i have an issue, here is an screendhot:
and my code:
[java]private void cargarAgua2(){
DirectionalLight sol = new DirectionalLight();
Vector3f luzDir = new Vector3f(-0.37352666f, -0.50444174f, -0.7784704f);
sol.setDirection(luzDir);
sol.setColor(ColorRGBA.White.clone().multLocal(2));
sceneModel.addLight(sol);
FilterPostProcessor filtroPos = new FilterPostProcessor(assetManager);
WaterFilter agua = new WaterFilter(terrain, luzDir);
agua.setWaterHeight(-6);
agua.setUseFoam(false);
agua.setUseRipples(false);
agua.setDeepWaterColor(ColorRGBA.Brown);
agua.setWaterColor(ColorRGBA.Brown.mult(ColorRGBA.Green));
agua.setWaterTransparency(0.2f);
agua.setMaxAmplitude(0.3f);
agua.setWaveScale(.008f);
agua.setSpeed(0.1f);
agua.setShoreHardness(1.0f);
agua.setRefractionConstant(0.2f);
agua.setShininess(0.3f);
agua.setSunScale(1.0f);
agua.setColorExtinction(new Vector3f(10.0f, 20.0f, 30.0f));
filtroPos.addFilter(agua);
viewPort.addProcessor(filtroPos);
}[/java]
in the edge of the screen there are transparent-black stains.
if i set “//water.setSpeed(.03f);” en cero , the stains disappear. but if i set more speed, the stains move faster.
I fixed it, but for some reason I cannot commit the fix to the repo right now (some unavailable error). I’ll commit as soon as possible and I’ll report back
If you zoom in to the areas does the white disappear? if so try add extra pixel borders to the outside of the UV’s in the DiffuseMap or check your magnification/minifaction attributes
@nehon: I don’t know about the stock filter. I’m using the water filter in a FilterPostProcessor. Also I saw the issue in “TestPostWater” in the jme3-project (see the first screenshot).
I’ve attached a video. You’ll need to set the video to the highest quality. Otherwise it will not the visible. Look at the sails of the ship in the middle of the screen.
I fear this could be a driver issue because it worked on my notebook with a 620m but I got the same error on another pc with the same gpu. Updating the driver didn’t solved it.
Okay, I cannot describe how strange the last 30 minutes were. I played around with the fragment-shader files of the water filter, edited a little bit and reverted them to the last version from the jme3-repository.
And then, boom!, the bug was gone. There’s no change in any file. I’ve rebuild the whole engine and the game from scratch and the bug is gone. Damn I’ve reinstalled my whole gpu driver. Twice. And that didn’t do anything.
Sorry for the cursing but… What the fuck was that?
If this issue returns I’ll report it. For now I’m just confused and tired.
As I said it looks like you use anti aliasing. The water filter does something special for antialiasing or else…you basically have this issue.
The thing is only the water15.frag handles anti-aliasing, and not the water.frag. Maybe you have a computer that doesn’t support glsl1.5 (opengl 3.2) so the 1.0 shader is picked.
as a workaround to this, I would recommend using FXAA (even if you have o put it twice in the filter stack). It will be a lot faster than multi sampling with the water filter.
1 - To make a proper screenshot hit ALT-PRT_SCR (or whatever name it has on your keyboard) to get a screenshot of the window that has the focus. You won’t have to crop.
2 - Use the JAVA CODE TAGS. This makes the code 10 billion times easier to read and won’t put a LOT of people off.