Package com.jme3.post.filters
Class FogFilter
java.lang.Object
com.jme3.post.Filter
com.jme3.post.filters.FogFilter
- All Implemented Interfaces:
- Savable
A filter to render a fog effect
- 
Nested Class SummaryNested classes/interfaces inherited from class com.jme3.post.FilterFilter.Pass
- 
Field SummaryFields inherited from class com.jme3.post.FilterdefaultPass, enabled, material, postRenderPasses, processor
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionreturns the fog colorfloatreturns the fog densityfloatreturns the fog distanceprotected MaterialMust return the material used for this filter.protected voidinitFilter(AssetManager manager, RenderManager renderManager, ViewPort vp, int w, int h) Initialization of filter subclasses.protected booleanOverride this method and return true if your Filter needs the depth texturevoidread(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);voidsetFogColor(ColorRGBA fogColor) Sets the color of the fogvoidsetFogDensity(float fogDensity) Sets the density of the fog, a high value gives a thick fogvoidsetFogDistance(float fogDistance) the distance of the fog.voidwrite(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);Methods inherited from class com.jme3.post.Filtercleanup, cleanUpFilter, getDefaultPassDepthFormat, getDefaultPassTextureFormat, getName, getPostRenderPasses, getRenderedTexture, getRenderFrameBuffer, init, isEnabled, isRequiresBilinear, isRequiresSceneTexture, postFilter, postFrame, postQueue, preFrame, setDepthTexture, setEnabled, setName, setProcessor, setRenderedTexture, setRenderFrameBuffer
- 
Constructor Details- 
FogFilterpublic FogFilter()Creates a FogFilter
- 
FogFilterCreate a fog filter- Parameters:
- fogColor- the color of the fog (default is white)
- fogDensity- the density of the fog (default is 0.7)
- fogDistance- the distance of the fog (default is 1000)
 
 
- 
- 
Method Details- 
isRequiresDepthTextureprotected boolean isRequiresDepthTexture()Description copied from class:FilterOverride this method and return true if your Filter needs the depth texture- Overrides:
- isRequiresDepthTexturein class- Filter
- Returns:
- true if your Filter need the depth texture
 
- 
initFilterprotected void initFilter(AssetManager manager, RenderManager renderManager, ViewPort vp, int w, int h) Description copied from class:FilterInitialization of filter subclasses. This method is called once when the filter is added to the FilterPostProcessor It should contain Material initializations and extra passes initialization- Specified by:
- initFilterin class- Filter
- Parameters:
- manager- the assetManager
- renderManager- the renderManager
- vp- the viewPort where this filter is rendered
- w- the width of the filter
- h- the height of the filter
 
- 
getMaterialDescription copied from class:FilterMust return the material used for this filter. this method is called every frame.- Specified by:
- getMaterialin class- Filter
- Returns:
- the material used for this filter.
 
- 
getFogColorreturns the fog color- Returns:
- the pre-existing instance
 
- 
setFogColorSets the color of the fog- Parameters:
- fogColor- the desired color (alias created, default=(1,1,1,1))
 
- 
getFogDensitypublic float getFogDensity()returns the fog density- Returns:
- the density value
 
- 
setFogDensitypublic void setFogDensity(float fogDensity) Sets the density of the fog, a high value gives a thick fog- Parameters:
- fogDensity- the desired density (default=0.7)
 
- 
getFogDistancepublic float getFogDistance()returns the fog distance- Returns:
- the distance
 
- 
setFogDistancepublic void setFogDistance(float fogDistance) the distance of the fog. the higher the value the distant the fog looks- Parameters:
- fogDistance- the desired distance (in world units, default=1000)
 
- 
writeDescription copied from class:FilterOverride 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);- Specified by:
- writein interface- Savable
- Overrides:
- writein class- Filter
- Parameters:
- ex- the exporter (not null)
- Throws:
- IOException- from the exporter
 
- 
readDescription copied from class:FilterOverride 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);- Specified by:
- readin interface- Savable
- Overrides:
- readin class- Filter
- Throws:
- IOException
 
 
-