com.jme3.post.filters
Class FadeFilter

java.lang.Object
  extended by com.jme3.post.Filter
      extended by com.jme3.post.filters.FadeFilter
All Implemented Interfaces:
Savable

public class FadeFilter
extends Filter

Fade Filter allows you to make an animated fade effect on a scene.

See Also:
http://jmonkeyengine.org/groups/graphics/forum/topic/newbie-question-general-fade-inout-effect/#post-105559

Nested Class Summary
 
Nested classes/interfaces inherited from class com.jme3.post.Filter
Filter.Pass
 
Field Summary
 
Fields inherited from class com.jme3.post.Filter
defaultPass, enabled, material, postRenderPasses, processor
 
Constructor Summary
FadeFilter()
          Creates a FadeFilter
FadeFilter(float duration)
          Creates a FadeFilter with the given duration
 
Method Summary
 void fadeIn()
          fades the scene in (black to scene)
 void fadeOut()
          fades the scene out (scene to black)
 float getDuration()
          returns the duration of the effect
protected  Material getMaterial()
          Must return the material used for this filter.
 float getValue()
          return the current value of the fading can be used to chack if fade is complete (eg value=1)
protected  void initFilter(AssetManager manager, RenderManager renderManager, ViewPort vp, int w, int h)
          Initialization of sub classes filters This method is called once when the filter is added to the FilterPostProcessor It should contain Material initializations and extra passes initialization
 void pause()
           
protected  void preFrame(float tpf)
          Override this method if you want to modify parameters according to tpf before the rendering of the frame.
 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 setDuration(float duration)
          Sets the duration of the filter default is 1 second
 void setValue(float value)
          sets the fade value can be used to force complete black or compete scene
 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);
 
Methods inherited from class com.jme3.post.Filter
cleanup, cleanUpFilter, getDefaultPassDepthFormat, getDefaultPassTextureFormat, getName, getPostRenderPasses, getRenderedTexture, getRenderFrameBuffer, init, isEnabled, isRequiresDepthTexture, isRequiresSceneTexture, postFrame, postQueue, setDepthTexture, setEnabled, setName, setProcessor, setRenderedTexture, setRenderFrameBuffer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FadeFilter

public FadeFilter()
Creates a FadeFilter


FadeFilter

public FadeFilter(float duration)
Creates a FadeFilter with the given duration

Parameters:
duration -
Method Detail

getMaterial

protected Material getMaterial()
Description copied from class: Filter
Must return the material used for this filter. this method is called every frame.

Specified by:
getMaterial in class Filter
Returns:
the material used for this filter.

initFilter

protected void initFilter(AssetManager manager,
                          RenderManager renderManager,
                          ViewPort vp,
                          int w,
                          int h)
Description copied from class: Filter
Initialization of sub classes filters This method is called once when the filter is added to the FilterPostProcessor It should contain Material initializations and extra passes initialization

Specified by:
initFilter in 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

preFrame

protected void preFrame(float tpf)
Description copied from class: Filter
Override this method if you want to modify parameters according to tpf before the rendering of the frame. This is usefull for animated filters Also it can be the place to render pre passes

Overrides:
preFrame in class Filter
Parameters:
tpf - the time used to render the previous frame

getDuration

public float getDuration()
returns the duration of the effect

Returns:

setDuration

public void setDuration(float duration)
Sets the duration of the filter default is 1 second

Parameters:
duration -

fadeIn

public void fadeIn()
fades the scene in (black to scene)


fadeOut

public void fadeOut()
fades the scene out (scene to black)


pause

public void pause()

write

public void write(JmeExporter ex)
           throws java.io.IOException
Description copied from class: 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);

Specified by:
write in interface Savable
Overrides:
write in class Filter
Throws:
java.io.IOException

read

public void read(JmeImporter im)
          throws java.io.IOException
Description copied from class: 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);

Specified by:
read in interface Savable
Overrides:
read in class Filter
Throws:
java.io.IOException

getValue

public float getValue()
return the current value of the fading can be used to chack if fade is complete (eg value=1)

Returns:

setValue

public void setValue(float value)
sets the fade value can be used to force complete black or compete scene

Parameters:
value -