com.jme3.water
クラス WaterFilter

java.lang.Object
  上位を拡張 com.jme3.post.Filter
      上位を拡張 com.jme3.water.WaterFilter
すべての実装されたインタフェース:
Savable

public class WaterFilter
extends Filter

The WaterFilter is a 2D post process that simulate water. It renders water above and under water. See this blog post for more info http://jmonkeyengine.org/2011/01/15/new-advanced-water-effect-for-jmonkeyengine-3/


入れ子のクラスの概要
 
クラス com.jme3.post.Filter から継承された入れ子のクラス/インタフェース
Filter.Pass
 
コンストラクタの概要
WaterFilter()
          Create a Water Filter
WaterFilter(Node reflectionScene, Vector3f lightDirection)
           
 
メソッドの概要
 float getCausticsIntensity()
          get the intensity of caustics under water
 Vector3f getColorExtinction()
          Returns the color exctinction vector of the water
 ColorRGBA getDeepWaterColor()
          returns the deep water color
 Vector3f getFoamExistence()
          returns the foam existance vector
 float getFoamHardness()
          returns the foam hardness
 float getFoamIntensity()
          returns the foam intensity
 ColorRGBA getLightColor()
          returns the light color
 Vector3f getLightDirection()
          gets the light direction
 float getMaxAmplitude()
          return the maximum wave amplitude
 float getNormalScale()
          Returns the normal scales applied to the normal map
 float getReflectionDisplace()
          returns the reflection displace see setReflectionDisplace(float reflectionDisplace)
 int getReflectionMapSize()
          returns the size of the reflection map
 float getRefractionConstant()
          returns the refractoin constant
 float getRefractionStrength()
          returns the refractionStrenght
 float getShininess()
          return the shininess factor of the water
 float getShoreHardness()
          Return the shoreHardeness
 float getSpeed()
          retruns the speed of the waves
 float getSunScale()
          gets the scale of the sun
 float getUnderWaterFogDistance()
          returns the distance of the fog when under water
 ColorRGBA getWaterColor()
          returns the color of the water
 float getWaterHeight()
          gets the height of the water plane
 float getWaterTransparency()
          returns the waterTransparency value
 float getWaveScale()
          returns the scale factor of the waves height map
 Vector2f getWindDirection()
          returns the wind direction
 boolean isUnderWater()
          returns true if the camera is under the water level
 boolean isUseCaustics()
          returns true if caustics are rendered
 boolean isUseFoam()
          returns true if the water uses foam
 boolean isUseHQShoreline()
          return true
 boolean isUseRefraction()
          returns true if the water use the refraction
 boolean isUseRipples()
          returns true if the ater use ripples
 boolean isUseSpecular()
          returns true if the water use specular
 void read(JmeImporter im)
          Override this method if you want to load extra properties when the filter is loaded else only basic properties of the filter will be loaded This method should always begin by super.read(im);
 void setCausticsIntensity(float causticsIntensity)
          sets the intensity of caustics under water. goes from 0 to 1, default is 0.5f
 void setCausticsTexture(Texture2D causticsTexture)
          sets the texture to use to render caustics on the ground underwater
 void setColorExtinction(Vector3f colorExtinction)
          Return at what depth the refraction color extinct the first value is for red the second is for green the third is for blue Play with thos parameters to "trouble" the water default is (5.0, 20.0, 30.0f);
 void setDeepWaterColor(ColorRGBA deepWaterColor)
          sets the deep water color see setWaterColor for general color default is (0.0039f, 0.00196f, 0.145f,1.0f) (very dark blue)
 void setFoamExistence(Vector3f foamExistence)
          Describes at what depth foam starts to fade out and at what it is completely invisible.
 void setFoamHardness(float foamHardness)
          Sets the foam hardness : How much the foam will blend with the shore to avoid hard edged water plane.
 void setFoamIntensity(float foamIntensity)
          sets the foam intensity default is 0.5f
 void setFoamTexture(Texture2D foamTexture)
          Sets the foam texture
 void setHeightTexture(Texture2D heightTexture)
          Sets the height texture
 void setLightColor(ColorRGBA lightColor)
          Sets the light color to use default is white
 void setLightDirection(Vector3f lightDirection)
          Sets the light direction
 void setMaxAmplitude(float maxAmplitude)
          Sets the maximum waves amplitude default is 1.0
 void setNormalScale(float normalScale)
          Sets the normal scaling factors to apply to the normal map.
 void setNormalTexture(Texture2D normalTexture)
          Sets the normal Texture
 void setReflectionDisplace(float reflectionDisplace)
          Sets the reflection displace. define how troubled will look the reflection in the water. default is 30
 void setReflectionMapSize(int reflectionMapSize)
          Sets the size of the reflection map default is 512, the higher, the better quality, but the slower the effect.
 void setReflectionScene(Spatial reflectionScene)
          sets the scene to render in the reflection map
 void setRefractionConstant(float refractionConstant)
          This is a constant related to the index of refraction (IOR) used to compute the fresnel term.
 void setRefractionStrength(float refractionStrength)
          This value modifies current fresnel term.
 void setShininess(float shininess)
          Sets the shinines factor of the water default is 0.7f
 void setShoreHardness(float shoreHardness)
          The smaller this value is, the softer the transition between shore and water.
 void setSpeed(float speed)
          Set the speed of the waves (0.0 is still) default is 1.0
 void setSunScale(float sunScale)
          Sets the scale of the sun for specular effect
 void setUnderWaterFogDistance(float underWaterFogDistance)
          sets the distance of the fog when under water.
 void setUseCaustics(boolean useCaustics)
          set to true if you want caustics to be rendered on the ground underwater, false otherwise
 void setUseFoam(boolean useFoam)
          set to true to use foam with water default true
 void setUseHQShoreline(boolean useHQShoreline)
           
 void setUseRefraction(boolean useRefraction)
          set to true to use refraction (default is true)
 void setUseRipples(boolean useRipples)
          Set to true tu use ripples
 void setUseSpecular(boolean useSpecular)
          Set to true to use specular lightings on the water
 void setWaterColor(ColorRGBA waterColor)
          Sets the color of the water see setDeepWaterColor for deep water color default is (0.0078f, 0.5176f, 0.5f,1.0f) (greenish blue)
 void setWaterHeight(float waterHeight)
          Sets the height of the water plane default is 0.0
 void setWaterTransparency(float waterTransparency)
          Sets how fast will colours fade out.
 void setWaveScale(float waveScale)
          Sets the scale factor of the waves height map the smaller the value the bigger the waves default is 0.005f
 void setWindDirection(Vector2f windDirection)
          sets the wind direction the direction where the waves move default is (0.0f, -1.0f)
 void write(JmeExporter ex)
          Override this method if you want to save extra properties when the filter is saved else only basic properties of the filter will be saved This method should always begin by super.write(ex);
 
クラス com.jme3.post.Filter から継承されたメソッド
getName, isEnabled, setEnabled, setName
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

WaterFilter

public WaterFilter()
Create a Water Filter


WaterFilter

public WaterFilter(Node reflectionScene,
                   Vector3f lightDirection)
メソッドの詳細

write

public void write(JmeExporter ex)
           throws java.io.IOException
クラス Filter の記述:
Override this method if you want to save extra properties when the filter is saved else only basic properties of the filter will be saved This method should always begin by super.write(ex);

定義:
インタフェース Savable 内の write
オーバーライド:
クラス Filter 内の write
例外:
java.io.IOException

read

public void read(JmeImporter im)
          throws java.io.IOException
クラス Filter の記述:
Override this method if you want to load extra properties when the filter is loaded else only basic properties of the filter will be loaded This method should always begin by super.read(im);

定義:
インタフェース Savable 内の read
オーバーライド:
クラス Filter 内の read
例外:
java.io.IOException

getWaterHeight

public float getWaterHeight()
gets the height of the water plane

戻り値:

setWaterHeight

public void setWaterHeight(float waterHeight)
Sets the height of the water plane default is 0.0

パラメータ:
waterHeight -

setReflectionScene

public void setReflectionScene(Spatial reflectionScene)
sets the scene to render in the reflection map

パラメータ:
reflectionScene -

getWaterTransparency

public float getWaterTransparency()
returns the waterTransparency value

戻り値:

setWaterTransparency

public void setWaterTransparency(float waterTransparency)
Sets how fast will colours fade out. You can also think about this values as how clear water is. Therefore use smaller values (eg. 0.05) to have crystal clear water and bigger to achieve "muddy" water. default is 0.1f

パラメータ:
waterTransparency -

getNormalScale

public float getNormalScale()
Returns the normal scales applied to the normal map

戻り値:

setNormalScale

public void setNormalScale(float normalScale)
Sets the normal scaling factors to apply to the normal map. the higher the value the more small ripples will be visible on the waves. default is 1.0

パラメータ:
normalScale -

getRefractionConstant

public float getRefractionConstant()
returns the refractoin constant

戻り値:

setRefractionConstant

public void setRefractionConstant(float refractionConstant)
This is a constant related to the index of refraction (IOR) used to compute the fresnel term. F = R0 + (1-R0)( 1 - N.V)^5 where F is the fresnel term, R0 the constant, N the normal vector and V tne view vector. It usually depend on the material you are lookinh through (here water). Default value is 0.3f In practice, the lowest the value and the less the reflection can be seen on water

パラメータ:
refractionConstant -

getMaxAmplitude

public float getMaxAmplitude()
return the maximum wave amplitude

戻り値:

setMaxAmplitude

public void setMaxAmplitude(float maxAmplitude)
Sets the maximum waves amplitude default is 1.0

パラメータ:
maxAmplitude -

getLightDirection

public Vector3f getLightDirection()
gets the light direction

戻り値:

setLightDirection

public void setLightDirection(Vector3f lightDirection)
Sets the light direction

パラメータ:
lightDirection -

getLightColor

public ColorRGBA getLightColor()
returns the light color

戻り値:

setLightColor

public void setLightColor(ColorRGBA lightColor)
Sets the light color to use default is white

パラメータ:
lightColor -

getShoreHardness

public float getShoreHardness()
Return the shoreHardeness

戻り値:

setShoreHardness

public void setShoreHardness(float shoreHardness)
The smaller this value is, the softer the transition between shore and water. If you want hard edges use very big value. Default is 0.1f.

パラメータ:
shoreHardness -

getFoamHardness

public float getFoamHardness()
returns the foam hardness

戻り値:

setFoamHardness

public void setFoamHardness(float foamHardness)
Sets the foam hardness : How much the foam will blend with the shore to avoid hard edged water plane. Default is 1.0

パラメータ:
foamHardness -

getRefractionStrength

public float getRefractionStrength()
returns the refractionStrenght

戻り値:

setRefractionStrength

public void setRefractionStrength(float refractionStrength)
This value modifies current fresnel term. If you want to weaken reflections use bigger value. If you want to empasize them use value smaller then 0. Default is 0.0f.

パラメータ:
refractionStrength -

getWaveScale

public float getWaveScale()
returns the scale factor of the waves height map

戻り値:

setWaveScale

public void setWaveScale(float waveScale)
Sets the scale factor of the waves height map the smaller the value the bigger the waves default is 0.005f

パラメータ:
waveScale -

getFoamExistence

public Vector3f getFoamExistence()
returns the foam existance vector

戻り値:

setFoamExistence

public void setFoamExistence(Vector3f foamExistence)
Describes at what depth foam starts to fade out and at what it is completely invisible. The third value is at what height foam for waves appear (+ waterHeight). default is (0.45, 4.35, 1.0);

パラメータ:
foamExistence -

getSunScale

public float getSunScale()
gets the scale of the sun

戻り値:

setSunScale

public void setSunScale(float sunScale)
Sets the scale of the sun for specular effect

パラメータ:
sunScale -

getColorExtinction

public Vector3f getColorExtinction()
Returns the color exctinction vector of the water

戻り値:

setColorExtinction

public void setColorExtinction(Vector3f colorExtinction)
Return at what depth the refraction color extinct the first value is for red the second is for green the third is for blue Play with thos parameters to "trouble" the water default is (5.0, 20.0, 30.0f);

パラメータ:
colorExtinction -

setFoamTexture

public void setFoamTexture(Texture2D foamTexture)
Sets the foam texture

パラメータ:
foamTexture -

setHeightTexture

public void setHeightTexture(Texture2D heightTexture)
Sets the height texture

パラメータ:
heightTexture -

setNormalTexture

public void setNormalTexture(Texture2D normalTexture)
Sets the normal Texture

パラメータ:
normalTexture -

getShininess

public float getShininess()
return the shininess factor of the water

戻り値:

setShininess

public void setShininess(float shininess)
Sets the shinines factor of the water default is 0.7f

パラメータ:
shininess -

getSpeed

public float getSpeed()
retruns the speed of the waves

戻り値:

setSpeed

public void setSpeed(float speed)
Set the speed of the waves (0.0 is still) default is 1.0

パラメータ:
speed -

getWaterColor

public ColorRGBA getWaterColor()
returns the color of the water

戻り値:

setWaterColor

public void setWaterColor(ColorRGBA waterColor)
Sets the color of the water see setDeepWaterColor for deep water color default is (0.0078f, 0.5176f, 0.5f,1.0f) (greenish blue)

パラメータ:
waterColour -

getDeepWaterColor

public ColorRGBA getDeepWaterColor()
returns the deep water color

戻り値:

setDeepWaterColor

public void setDeepWaterColor(ColorRGBA deepWaterColor)
sets the deep water color see setWaterColor for general color default is (0.0039f, 0.00196f, 0.145f,1.0f) (very dark blue)

パラメータ:
deepWaterColor -

getWindDirection

public Vector2f getWindDirection()
returns the wind direction

戻り値:

setWindDirection

public void setWindDirection(Vector2f windDirection)
sets the wind direction the direction where the waves move default is (0.0f, -1.0f)

パラメータ:
windDirection -

getReflectionMapSize

public int getReflectionMapSize()
returns the size of the reflection map

戻り値:

setReflectionMapSize

public void setReflectionMapSize(int reflectionMapSize)
Sets the size of the reflection map default is 512, the higher, the better quality, but the slower the effect.

パラメータ:
reflectionMapSize -

isUseFoam

public boolean isUseFoam()
returns true if the water uses foam

戻り値:

setUseFoam

public void setUseFoam(boolean useFoam)
set to true to use foam with water default true

パラメータ:
useFoam -

setCausticsTexture

public void setCausticsTexture(Texture2D causticsTexture)
sets the texture to use to render caustics on the ground underwater

パラメータ:
causticsTexture -

isUseCaustics

public boolean isUseCaustics()
returns true if caustics are rendered

戻り値:

setUseCaustics

public void setUseCaustics(boolean useCaustics)
set to true if you want caustics to be rendered on the ground underwater, false otherwise

パラメータ:
useCaustics -

isUseHQShoreline

public boolean isUseHQShoreline()
return true

戻り値:

setUseHQShoreline

public void setUseHQShoreline(boolean useHQShoreline)

isUseRefraction

public boolean isUseRefraction()
returns true if the water use the refraction

戻り値:

setUseRefraction

public void setUseRefraction(boolean useRefraction)
set to true to use refraction (default is true)

パラメータ:
useRefraction -

isUseRipples

public boolean isUseRipples()
returns true if the ater use ripples

戻り値:

setUseRipples

public void setUseRipples(boolean useRipples)
Set to true tu use ripples

パラメータ:
useRipples -

isUseSpecular

public boolean isUseSpecular()
returns true if the water use specular

戻り値:

setUseSpecular

public void setUseSpecular(boolean useSpecular)
Set to true to use specular lightings on the water

パラメータ:
useSpecular -

getFoamIntensity

public float getFoamIntensity()
returns the foam intensity

戻り値:

setFoamIntensity

public void setFoamIntensity(float foamIntensity)
sets the foam intensity default is 0.5f

パラメータ:
foamIntensity -

getReflectionDisplace

public float getReflectionDisplace()
returns the reflection displace see setReflectionDisplace(float reflectionDisplace)

戻り値:

setReflectionDisplace

public void setReflectionDisplace(float reflectionDisplace)
Sets the reflection displace. define how troubled will look the reflection in the water. default is 30

パラメータ:
reflectionDisplace -

isUnderWater

public boolean isUnderWater()
returns true if the camera is under the water level

戻り値:

getUnderWaterFogDistance

public float getUnderWaterFogDistance()
returns the distance of the fog when under water

戻り値:

setUnderWaterFogDistance

public void setUnderWaterFogDistance(float underWaterFogDistance)
sets the distance of the fog when under water. default is 120 (120 world units) use a high value to raise the view range under water

パラメータ:
underWaterFogDistance -

getCausticsIntensity

public float getCausticsIntensity()
get the intensity of caustics under water

戻り値:

setCausticsIntensity

public void setCausticsIntensity(float causticsIntensity)
sets the intensity of caustics under water. goes from 0 to 1, default is 0.5f

パラメータ:
causticsIntensity -