Tabnine Logo
WaterFilter
Code IndexAdd Tabnine to your IDE (free)

How to use
WaterFilter
in
com.jme3.water

Best Java code snippets using com.jme3.water.WaterFilter (Showing top 20 results out of 315)

origin: jMonkeyEngine/jmonkeyengine

private DirectionalLight findLight(Node node) {
  for (Light light : node.getWorldLightList()) {
    if (light instanceof DirectionalLight) {
      return (DirectionalLight) light;
    }
  }
  for (Spatial child : node.getChildren()) {
    if (child instanceof Node) {
      return findLight((Node) child);
    }
  }
  return null;
}
origin: jMonkeyEngine/jmonkeyengine

water = new WaterFilter(rootNode, lightDir);
water.setCenter(new Vector3f(9.628218f, -15.830074f, 199.23595f));
water.setRadius(260);
water.setWaveScale(0.003f);
water.setMaxAmplitude(2f);
water.setFoamExistence(new Vector3f(1f, 4, 0.5f));
water.setFoamTexture((Texture2D) assetManager.loadTexture("Common/MatDefs/Water/Textures/foam2.jpg"));
water.setRefractionStrength(0.2f);
water.setWaterHeight(WATER_HEIGHT);
fpp.addFilter(water);
WaterFilter water2 = new WaterFilter(rootNode, lightDir);
water2.setCenter(new Vector3f(-280.46027f, -24.971727f, -271.71976f));
water2.setRadius(260);
water2.setWaterHeight(WATER_HEIGHT);
water2.setUseFoam(false);
water2.setUseRipples(false);
water2.setDeepWaterColor(ColorRGBA.Brown);
water2.setWaterColor(ColorRGBA.Brown.mult(2.0f));
water2.setWaterTransparency(0.2f);
water2.setMaxAmplitude(0.3f);
water2.setWaveScale(0.008f);
water2.setSpeed(0.7f);
water2.setShoreHardness(1.0f);
water2.setRefractionConstant(0.2f);
water2.setShininess(0.3f);
water2.setSunScale(1.0f);
water2.setColorExtinction(new Vector3f(10.0f, 20.0f, 30.0f));
fpp.addFilter(water2);
origin: jMonkeyEngine/jmonkeyengine

/**
 * Sets the scene to render in the reflection map.
 *
 * @param reflectionScene the refraction scene.
 */
public void setReflectionScene(final Spatial reflectionScene) {
  final Spatial currentScene = getReflectionScene();
  if (reflectionView != null) {
    reflectionView.detachScene(currentScene == null? rootScene : currentScene);
  }
  this.reflectionScene = reflectionScene;
  if (reflectionView != null) {
    reflectionView.attachScene(reflectionScene == null? rootScene : reflectionScene);
  }
}
origin: jMonkeyEngine/jmonkeyengine

  public void onAction(String name, boolean isPressed, float tpf) {
    if (isPressed) {
      if (name.equals("foam1")) {
        water.setFoamTexture((Texture2D) assetManager.loadTexture("Common/MatDefs/Water/Textures/foam.jpg"));
      }
      if (name.equals("foam2")) {
        water.setFoamTexture((Texture2D) assetManager.loadTexture("Common/MatDefs/Water/Textures/foam2.jpg"));
      }
      if (name.equals("foam3")) {
        water.setFoamTexture((Texture2D) assetManager.loadTexture("Common/MatDefs/Water/Textures/foam3.jpg"));
      }
      if (name.equals("upRM")) {
        water.setReflectionMapSize(Math.min(water.getReflectionMapSize() * 2, 4096));
        System.out.println("Reflection map size : " + water.getReflectionMapSize());
      }
      if (name.equals("downRM")) {
        water.setReflectionMapSize(Math.max(water.getReflectionMapSize() / 2, 32));
        System.out.println("Reflection map size : " + water.getReflectionMapSize());
      }
    }
  }
}, "foam1", "foam2", "foam3", "upRM", "downRM");
origin: jMonkeyEngine/jmonkeyengine

final WaterFilter water = new WaterFilter(rootNode, lightDir);
water.setWaterHeight(-20);
water.setUseFoam(false);
water.setUseRipples(false);
water.setDeepWaterColor(ColorRGBA.Brown);
water.setWaterColor(ColorRGBA.Brown.mult(2.0f));
water.setWaterTransparency(0.2f);
water.setMaxAmplitude(0.3f);
water.setWaveScale(0.008f);
water.setSpeed(0.7f);
water.setShoreHardness(1.0f);
water.setRefractionConstant(0.2f);
water.setShininess(0.3f);
water.setSunScale(1.0f);
water.setColorExtinction(new Vector3f(10.0f, 20.0f, 30.0f));
fpp.addFilter(water);
viewPort.addProcessor(fpp);
origin: jMonkeyEngine/jmonkeyengine

water = new WaterFilter(rootNode, lightDir);
water.setWaterColor(new ColorRGBA().setAsSrgb(0.0078f, 0.3176f, 0.5f, 1.0f));
water.setDeepWaterColor(new ColorRGBA().setAsSrgb(0.0039f, 0.00196f, 0.145f, 1.0f));
water.setUnderWaterFogDistance(80);
water.setWaterTransparency(0.12f);
water.setFoamIntensity(0.4f);        
water.setFoamHardness(0.3f);
water.setFoamExistence(new Vector3f(0.8f, 8f, 1f));
water.setReflectionDisplace(50);
water.setRefractionConstant(0.25f);
water.setColorExtinction(new Vector3f(30, 50, 70));
water.setCausticsIntensity(0.4f);        
water.setWaveScale(0.003f);
water.setMaxAmplitude(2f);
water.setFoamTexture((Texture2D) assetManager.loadTexture("Common/MatDefs/Water/Textures/foam2.jpg"));
water.setRefractionStrength(0.2f);
water.setWaterHeight(initialWaterHeight);
origin: jMonkeyEngine/jmonkeyengine

setCausticsTexture((Texture2D) assetManager.loadTexture(causticsTextureKey));
setHeightTexture((Texture2D) assetManager.loadTexture(heightTextureKey));
setNormalTexture((Texture2D) assetManager.loadTexture(normalTextureKey));
setFoamTexture((Texture2D) assetManager.loadTexture(foamTextureKey));
origin: jMonkeyEngine/jmonkeyengine

DirectionalLight directionalLight = findLight((Node) reflectionScene);
if (directionalLight != null && useDirectionLightFromScene()) {
  lightDirection = directionalLight.getDirection();
origin: jMonkeyEngine/jmonkeyengine

final Spatial reflectionScene = getReflectionScene();
final boolean needSaveReflectionScene = isNeedSaveReflectionScene();
origin: jMonkeyEngine/jmonkeyengine

final WaterFilter water=new WaterFilter(rootNode,new Vector3f(-0.4790551f, -0.39247334f, -0.7851566f));
water.setWaterHeight(-20);
SSAOUI ui=new SSAOUI(inputManager,ssaoFilter);
final BloomFilter bloom = new BloomFilter();
origin: org.activecomponents.jadex/jadex-kernel-extension-envsupport-jmonkey

public Spatial draw(DrawableCombiner3d dc, Primitive3d primitive,
    SpaceObject sobj, ViewportJMonkey vp) {
  Vector3f lightDir = new Vector3f(1f, 1f, 1f);
  WaterFilter water = new WaterFilter(waterNode, lightDir);
  water.setWaterHeight(-0.2f);
  water.setUseFoam(false);
  water.setUseRipples(true);
  water.setDeepWaterColor(ColorRGBA.Black.mult(0.1f));
  water.setWaterColor(ColorRGBA.Black.mult(0.15f));
  water.setWaterTransparency(0.001f);
  water.setMaxAmplitude(0.3f);
  water.setWaveScale(0.008f);
  water.setSpeed(0.5f);
  water.setShoreHardness(1.0f);
  water.setRefractionConstant(0.2f);
  water.setShininess(0.3f);
  water.setSunScale(1.0f);
  water.setColorExtinction(new Vector3f(10.0f, 20.0f, 30.0f));
  
  waterNode.setUserData("water", water);
  
  return waterNode;
}
origin: org.jmonkeyengine/jme3-effects

setCausticsTexture((Texture2D) assetManager.loadTexture(causticsTextureKey));
setHeightTexture((Texture2D) assetManager.loadTexture(heightTextureKey));
setNormalTexture((Texture2D) assetManager.loadTexture(normalTextureKey));
setFoamTexture((Texture2D) assetManager.loadTexture(foamTextureKey));
origin: org.jmonkeyengine/jme3-effects

DirectionalLight directionalLight = findLight((Node) reflectionScene);
if (directionalLight != null && useDirectionLightFromScene()) {
  lightDirection = directionalLight.getDirection();
origin: org.jmonkeyengine/jme3-effects

final Spatial reflectionScene = getReflectionScene();
final boolean needSaveReflectionScene = isNeedSaveReflectionScene();
origin: org.jmonkeyengine/jme3-effects

private DirectionalLight findLight(Node node) {
  for (Light light : node.getWorldLightList()) {
    if (light instanceof DirectionalLight) {
      return (DirectionalLight) light;
    }
  }
  for (Spatial child : node.getChildren()) {
    if (child instanceof Node) {
      return findLight((Node) child);
    }
  }
  return null;
}
origin: org.jmonkeyengine/jme3-effects

/**
 * Sets the scene to render in the reflection map.
 *
 * @param reflectionScene the refraction scene.
 */
public void setReflectionScene(final Spatial reflectionScene) {
  final Spatial currentScene = getReflectionScene();
  if (reflectionView != null) {
    reflectionView.detachScene(currentScene == null? rootScene : currentScene);
  }
  this.reflectionScene = reflectionScene;
  if (reflectionView != null) {
    reflectionView.attachScene(reflectionScene == null? rootScene : reflectionScene);
  }
}
origin: us.ihmc.thirdparty.jme/jme3-effects

private DirectionalLight findLight(Node node) {
  for (Light light : node.getWorldLightList()) {
    if (light instanceof DirectionalLight) {
      return (DirectionalLight) light;
    }
  }
  for (Spatial child : node.getChildren()) {
    if (child instanceof Node) {
      return findLight((Node) child);
    }
  }
  return null;
}
origin: info.projectkyoto/mms-engine

private DirectionalLight findLight(Node node) {
  for (Light light : node.getWorldLightList()) {
    if (light instanceof DirectionalLight) {
      return (DirectionalLight) light;
    }
  }
  for (Spatial child : node.getChildren()) {
    if (child instanceof Node) {
      return findLight((Node) child);
    }
  }
  return null;
}
origin: info.projectkyoto/mms-engine

DirectionalLight l = findLight((Node) reflectionScene);
if (l != null) {
  lightDirection = l.getDirection();
origin: us.ihmc.thirdparty.jme/jme3-effects

DirectionalLight l = findLight((Node) reflectionScene);
if (l != null) {
  lightDirection = l.getDirection();
com.jme3.waterWaterFilter

Javadoc

The WaterFilter is a 2D post process that simulate water. It renders water above and under water. See the jMonkeyEngine wiki for more info https://jmonkeyengine.github.io/wiki/jme3/advanced/post-processor_water.html.

Most used methods

  • findLight
  • setFoamTexture
    Sets the foam texture
  • <init>
  • getReflectionScene
    Gets the scene which is used to render in the reflection map.
  • isNeedSaveReflectionScene
  • setCausticsTexture
    sets the texture to use to render caustics on the ground underwater
  • setColorExtinction
    Return at what depth the refraction color extinct the first value is for red the second is for green
  • setDeepWaterColor
    sets the deep water color see setWaterColor for general color default is (0.0039f, 0.00196f, 0.145f,
  • setHeightTexture
    Sets the height texture
  • setMaxAmplitude
    Sets the maximum waves amplitude default is 1.0
  • setNormalTexture
    Sets the normal Texture
  • setRefractionConstant
    This is a constant related to the index of refraction (IOR) used to compute the fresnel term. F = R0
  • setNormalTexture,
  • setRefractionConstant,
  • setShininess,
  • setShoreHardness,
  • setSpeed,
  • setSunScale,
  • setUseFoam,
  • setUseRipples,
  • setWaterColor,
  • setWaterHeight

Popular in Java

  • Reactive rest calls using spring rest template
  • getSharedPreferences (Context)
  • runOnUiThread (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • String (java.lang)
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • JTable (javax.swing)
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now