|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme.renderer.pass.Pass
com.jmex.effects.water.WaterRenderPass
public class WaterRenderPass
WaterRenderPass
Water effect pass.
Field Summary | |
---|---|
protected boolean |
aboveWater
|
protected BlendState |
as1
|
protected Vector3f |
binormal
|
protected Vector3f |
calcVect
|
protected Camera |
cam
|
protected float |
clipBias
|
protected ClipState |
clipState
|
protected CullState |
cullBackFace
|
protected java.lang.String |
currentShaderStr
|
static java.lang.String |
dudvMapTextureString
|
static java.lang.String |
fallbackMapTextureString
|
protected TextureState |
fallbackTextureState
|
static java.lang.String |
foamMapTextureString
|
protected float |
heightFalloffSpeed
|
protected float |
heightFalloffStart
|
protected FogState |
noFog
|
static java.lang.String |
normalMapTextureString
|
protected float |
normalTranslation
|
static java.lang.String |
projectedShaderRefractionStr
|
static java.lang.String |
projectedShaderStr
|
protected float |
reflectionThrottle
|
protected float |
reflectionTime
|
protected float |
refractionThrottle
|
protected float |
refractionTime
|
protected float |
refractionTranslation
|
protected java.util.ArrayList<Spatial> |
renderList
|
protected int |
renderScale
|
static java.lang.String |
simpleShaderRefractionStr
|
static java.lang.String |
simpleShaderStr
|
protected Node |
skyBox
|
protected float |
speedReflection
|
protected float |
speedRefraction
|
protected boolean |
supported
|
protected Vector3f |
tangent
|
protected java.util.ArrayList<Texture> |
texArray
|
protected Texture2D |
textureDepth
|
protected Texture2D |
textureReflect
|
protected Texture2D |
textureRefract
|
protected TextureState |
textureState
|
protected float |
tpf
|
protected TextureRenderer |
tRenderer
|
protected boolean |
useFadeToFogColor
|
protected boolean |
useProjectedShader
|
protected boolean |
useReflection
|
protected boolean |
useRefraction
|
protected ColorRGBA |
waterColorEnd
|
protected ColorRGBA |
waterColorStart
|
protected float |
waterMaxAmplitude
|
protected Plane |
waterPlane
|
protected GLSLShaderObjectsState |
waterShader
|
Fields inherited from class com.jme.renderer.pass.Pass |
---|
context, enabled, passStates, savedStates, spatials, zFactor, zOffset |
Constructor Summary | |
---|---|
WaterRenderPass(Camera cam,
int renderScale,
boolean useProjectedShader,
boolean useRefraction)
Creates a new WaterRenderPass |
Method Summary | |
---|---|
void |
addReflectedScene(Spatial renderNode)
Adds a spatial to the list of spatials used as reflection in the water |
void |
cleanup()
Release pbuffers in TextureRenderer's. |
void |
clearReflectedScene()
|
void |
doRender(Renderer r)
|
protected void |
doUpdate(float tpf)
|
Vector3f |
getBinormal()
|
Camera |
getCam()
|
float |
getClipBias()
|
Texture |
getDudvTexture()
|
Texture |
getFallbackTexture()
|
Texture |
getFoamTexture()
|
float |
getHeightFalloffSpeed()
|
float |
getHeightFalloffStart()
|
Vector3f |
getNormal()
|
Texture |
getNormalmapTexture()
|
float |
getReflectionThrottle()
|
float |
getRefractionThrottle()
|
int |
getRenderScale()
|
float |
getSpeedReflection()
|
float |
getSpeedRefraction()
|
Vector3f |
getTangent()
|
Texture |
getTextureDepth()
|
Texture |
getTextureReflect()
|
Texture |
getTextureRefract()
|
TextureState |
getTextureState()
|
ColorRGBA |
getWaterColorEnd()
|
ColorRGBA |
getWaterColorStart()
|
float |
getWaterHeight()
|
float |
getWaterMaxAmplitude()
|
Plane |
getWaterPlane()
|
boolean |
isSupported()
|
boolean |
isUseFadeToFogColor()
|
boolean |
isUseProjectedShader()
|
boolean |
isUseReflection()
|
boolean |
isUseRefraction()
|
void |
reloadShader()
|
void |
removeReflectedScene(Spatial renderNode)
|
void |
resetParameters()
Resets water parameters to default values |
void |
setBinormal(Vector3f binormal)
|
void |
setCam(Camera cam)
|
void |
setClipBias(float clipBias)
|
void |
setDudvTexture(Texture dudvTexture)
|
void |
setFallbackEffectOnSpatial(Spatial spatial)
|
void |
setFallbackTexture(Texture fallbackTexture)
|
void |
setFoamTexture(Texture foamTexture)
|
void |
setHeightFalloffSpeed(float heightFalloffSpeed)
Set the fadeout length of the waveheights, when over falloff start(for projected water only) |
void |
setHeightFalloffStart(float heightFalloffStart)
Set at what distance the waveheights should start to fade out(for projected water only) |
void |
setNormal(Vector3f normal)
Set the normal of the waterplane(Used for reflecting the camera for rendering reflection) |
void |
setNormalmapTexture(Texture normalmapTexture)
|
void |
setReflectedScene(Spatial renderNode)
Sets spatial to be used as reflection in the water(clears previously set) |
void |
setReflectionThrottle(float reflectionThrottle)
|
void |
setRefractionThrottle(float refractionThrottle)
|
void |
setRenderScale(int renderScale)
|
void |
setSkybox(Node skyBox)
Sets up a node to be transformed and clipped for skybox usage |
void |
setSpeedReflection(float speedReflection)
Set the movement speed of the reflectiontexture |
void |
setSpeedRefraction(float speedRefraction)
Set the movement speed of the refractiontexture |
void |
setTangent(Vector3f tangent)
|
void |
setTextureState(TextureState textureState)
|
protected void |
setupTextures()
|
void |
setUseProjectedShader(boolean useProjectedShader)
|
void |
setUseReflection(boolean useReflection)
Turn reflection on and off |
void |
setUseRefraction(boolean useRefraction)
Turn refraction on and off |
void |
setWaterColorEnd(ColorRGBA waterColorEnd)
Color to use when the incident angle to the surface is high |
void |
setWaterColorStart(ColorRGBA waterColorStart)
Color to use when the incident angle to the surface is low |
void |
setWaterEffectOnSpatial(Spatial spatial)
Sets a spatial up for being rendered with the watereffect |
void |
setWaterEffectOnSpatial(Spatial spatial,
boolean useTransparency)
|
void |
setWaterHeight(float waterHeight)
Set base height of the waterplane(Used for reflecting the camera for rendering reflection) |
void |
setWaterMaxAmplitude(float waterMaxAmplitude)
Maximum amplitude of the water, used for clipping correctly(projected water only) |
void |
setWaterPlane(Plane waterPlane)
|
void |
updateCamera()
|
protected void |
updateTranslations()
|
void |
useFadeToFogColor(boolean value)
If true, fade to fogcolor. |
Methods inherited from class com.jme.renderer.pass.Pass |
---|
add, applyPassStates, cleanUp, clearPassState, clearPassState, clearPassStates, contains, get, getRenderState, getRenderState, getZFactor, getZOffset, isEnabled, remove, removeAll, renderPass, resetOldStates, setEnabled, setPassState, setZFactor, setZOffset, size, updatePass |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Camera cam
protected float tpf
protected float reflectionThrottle
protected float refractionThrottle
protected float reflectionTime
protected float refractionTime
protected boolean useFadeToFogColor
protected TextureRenderer tRenderer
protected Texture2D textureReflect
protected Texture2D textureRefract
protected Texture2D textureDepth
protected java.util.ArrayList<Spatial> renderList
protected java.util.ArrayList<Texture> texArray
protected Node skyBox
protected GLSLShaderObjectsState waterShader
protected CullState cullBackFace
protected TextureState textureState
protected TextureState fallbackTextureState
protected BlendState as1
protected ClipState clipState
protected FogState noFog
protected Plane waterPlane
protected Vector3f tangent
protected Vector3f binormal
protected Vector3f calcVect
protected float clipBias
protected ColorRGBA waterColorStart
protected ColorRGBA waterColorEnd
protected float heightFalloffStart
protected float heightFalloffSpeed
protected float waterMaxAmplitude
protected float speedReflection
protected float speedRefraction
protected boolean aboveWater
protected float normalTranslation
protected float refractionTranslation
protected boolean supported
protected boolean useProjectedShader
protected boolean useRefraction
protected boolean useReflection
protected int renderScale
public static java.lang.String simpleShaderStr
public static java.lang.String simpleShaderRefractionStr
public static java.lang.String projectedShaderStr
public static java.lang.String projectedShaderRefractionStr
protected java.lang.String currentShaderStr
public static java.lang.String normalMapTextureString
public static java.lang.String dudvMapTextureString
public static java.lang.String foamMapTextureString
public static java.lang.String fallbackMapTextureString
Constructor Detail |
---|
public WaterRenderPass(Camera cam, int renderScale, boolean useProjectedShader, boolean useRefraction)
cam
- main rendercam to use for reflection settings etcrenderScale
- how many times smaller the reflection/refraction textures should be compared to the main displayuseProjectedShader
- true - use the projected setup for variable height water meshes, false - use the flast shader setupuseRefraction
- enable/disable rendering of refraction texturesMethod Detail |
---|
public void resetParameters()
public void cleanup()
public boolean isSupported()
protected void setupTextures()
protected void doUpdate(float tpf)
doUpdate
in class Pass
public void doRender(Renderer r)
doRender
in class Pass
protected void updateTranslations()
public void reloadShader()
public void setWaterEffectOnSpatial(Spatial spatial, boolean useTransparency)
public void setWaterEffectOnSpatial(Spatial spatial)
spatial
- Spatial to use as base for the watereffectpublic void setFallbackEffectOnSpatial(Spatial spatial)
public void removeReflectedScene(Spatial renderNode)
public void clearReflectedScene()
public void setReflectedScene(Spatial renderNode)
renderNode
- Spatial to use as reflection in the waterpublic void addReflectedScene(Spatial renderNode)
renderNode
- Spatial to add to the list of objects used as reflection in the waterpublic void setSkybox(Node skyBox)
skyBox
- Handle to a node to use as skyboxpublic Camera getCam()
public void setCam(Camera cam)
public ColorRGBA getWaterColorStart()
public void setWaterColorStart(ColorRGBA waterColorStart)
public ColorRGBA getWaterColorEnd()
public void setWaterColorEnd(ColorRGBA waterColorEnd)
public float getHeightFalloffStart()
public void setHeightFalloffStart(float heightFalloffStart)
heightFalloffStart
- public float getHeightFalloffSpeed()
public void setHeightFalloffSpeed(float heightFalloffSpeed)
heightFalloffStart
- public float getWaterHeight()
public void setWaterHeight(float waterHeight)
waterHeight
- Waterplane heightpublic Vector3f getNormal()
public void setNormal(Vector3f normal)
normal
- Waterplane normalpublic float getSpeedReflection()
public void setSpeedReflection(float speedReflection)
speedReflection
- Speed of reflectiontexturepublic float getSpeedRefraction()
public void setSpeedRefraction(float speedRefraction)
speedRefraction
- Speed of refractiontexturepublic float getWaterMaxAmplitude()
public void setWaterMaxAmplitude(float waterMaxAmplitude)
waterMaxAmplitude
- Maximum amplitudepublic float getClipBias()
public void setClipBias(float clipBias)
public Plane getWaterPlane()
public void setWaterPlane(Plane waterPlane)
public Vector3f getTangent()
public void setTangent(Vector3f tangent)
public Vector3f getBinormal()
public void setBinormal(Vector3f binormal)
public Texture getTextureReflect()
public Texture getTextureRefract()
public Texture getTextureDepth()
public void useFadeToFogColor(boolean value)
value
- public boolean isUseFadeToFogColor()
public boolean isUseReflection()
public void setUseReflection(boolean useReflection)
useReflection
- public boolean isUseRefraction()
public void setUseRefraction(boolean useRefraction)
useRefraction
- public int getRenderScale()
public void setRenderScale(int renderScale)
public boolean isUseProjectedShader()
public void setUseProjectedShader(boolean useProjectedShader)
public float getReflectionThrottle()
public void setReflectionThrottle(float reflectionThrottle)
public float getRefractionThrottle()
public void setRefractionThrottle(float refractionThrottle)
public TextureState getTextureState()
public void setTextureState(TextureState textureState)
public void updateCamera()
public void setFallbackTexture(Texture fallbackTexture)
public Texture getFallbackTexture()
public void setNormalmapTexture(Texture normalmapTexture)
public Texture getNormalmapTexture()
public void setDudvTexture(Texture dudvTexture)
public Texture getDudvTexture()
public void setFoamTexture(Texture foamTexture)
public Texture getFoamTexture()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |