Package com.jme3.post
Class FilterPostProcessor
java.lang.Object
com.jme3.post.FilterPostProcessor
- All Implemented Interfaces:
Savable
,SceneProcessor
A FilterPostProcessor is a processor that can apply several
It manages a list of filters that will be applied in the order in which they've been added to the list
Filter
s to a rendered sceneIt manages a list of filters that will be applied in the order in which they've been added to the list
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
Don't use this constructor, useFilterPostProcessor(AssetManager assetManager)
This constructor is used for serialization onlyFilterPostProcessor
(AssetManager assetManager) Create a FilterProcessor -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a filter to the filters listvoid
cleanup()
Called when the SP is removed from the RM.For internal use only
returns the depth texture of the scene<T extends Filter>
Treturns the first filter in the list assignable from the given typereturns an unmodifiable version of the filter list.For internal use only
returns the rendered texture of the sceneReturns the depth format currently used for the internal frame buffer's depth bufferint
return the number of samples for antialiasingvoid
initialize
(RenderManager rm, ViewPort vp) Called in the render thread to initialize the scene processor.boolean
void
postFrame
(FrameBuffer out) Called after a frame has been rendered and the queue flushed.void
postQueue
(RenderQueue rq) Called after the scene graph has been queued, but before it is flushed.void
preFrame
(float tpf) Called before a framevoid
read
(JmeImporter im) void
Removes all the filters from this processorvoid
removeFilter
(Filter filter) removes this filters from the filters listvoid
Called when the resolution of the viewport has been changed.void
setAssetManager
(AssetManager assetManager) Sets the asset manager for this processorprotected void
setFilterState
(Filter filter, boolean enabled) sets the filter to enabled or disabledvoid
setFrameBufferDepthFormat
(Image.Format depthFormat) Sets the format to be used for the internal frame buffer's depth buffervoid
setFrameBufferFormat
(Image.Format fbFormat) Sets the format to be used for the internal frame buffer's color buffervoid
setNumSamples
(int numSamples) Sets the number of samples for antialiasingvoid
setProfiler
(AppProfiler profiler) Sets a profiler Instance for this processor.void
write
(JmeExporter ex) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.jme3.post.SceneProcessor
rescale
-
Field Details
-
FPP
-
-
Constructor Details
-
FilterPostProcessor
Create a FilterProcessor- Parameters:
assetManager
- the assetManager
-
FilterPostProcessor
protected FilterPostProcessor()Don't use this constructor, useFilterPostProcessor(AssetManager assetManager)
This constructor is used for serialization only
-
-
Method Details
-
addFilter
Adds a filter to the filters list- Parameters:
filter
- the filter to add
-
removeFilter
removes this filters from the filters list- Parameters:
filter
- the Filter to remove (not null)
-
getFilterIterator
-
initialize
Description copied from interface:SceneProcessor
Called in the render thread to initialize the scene processor.- Specified by:
initialize
in interfaceSceneProcessor
- Parameters:
rm
- The render manager to which the SP was added tovp
- The viewport to which the SP is assigned
-
getDefaultPassTextureFormat
-
isInitialized
public boolean isInitialized()- Specified by:
isInitialized
in interfaceSceneProcessor
- Returns:
- True if initialize() has been called on this SceneProcessor, false if otherwise.
-
postQueue
Description copied from interface:SceneProcessor
Called after the scene graph has been queued, but before it is flushed.- Specified by:
postQueue
in interfaceSceneProcessor
- Parameters:
rq
- The render queue
-
postFrame
Description copied from interface:SceneProcessor
Called after a frame has been rendered and the queue flushed.- Specified by:
postFrame
in interfaceSceneProcessor
- Parameters:
out
- The FB to which the scene was rendered.
-
preFrame
public void preFrame(float tpf) Description copied from interface:SceneProcessor
Called before a frame- Specified by:
preFrame
in interfaceSceneProcessor
- Parameters:
tpf
- Time per frame
-
setFilterState
sets the filter to enabled or disabled- Parameters:
filter
- the Filter to modify (not null)enabled
- true to enable, false to disable
-
cleanup
public void cleanup()Description copied from interface:SceneProcessor
Called when the SP is removed from the RM.- Specified by:
cleanup
in interfaceSceneProcessor
-
setProfiler
Description copied from interface:SceneProcessor
Sets a profiler Instance for this processor.- Specified by:
setProfiler
in interfaceSceneProcessor
- Parameters:
profiler
- the profiler instance.
-
reshape
Description copied from interface:SceneProcessor
Called when the resolution of the viewport has been changed.- Specified by:
reshape
in interfaceSceneProcessor
- Parameters:
vp
- the affected ViewPortw
- the new width (in pixels)h
- the new height (in pixels)
-
getNumSamples
public int getNumSamples()return the number of samples for antialiasing- Returns:
- numSamples
-
removeAllFilters
public void removeAllFilters()Removes all the filters from this processor -
setNumSamples
public void setNumSamples(int numSamples) Sets the number of samples for antialiasing- Parameters:
numSamples
- the number of Samples
-
setAssetManager
Sets the asset manager for this processor- Parameters:
assetManager
- to load assets
-
setFrameBufferFormat
Sets the format to be used for the internal frame buffer's color buffer- Parameters:
fbFormat
- the format
-
setFrameBufferDepthFormat
Sets the format to be used for the internal frame buffer's depth buffer- Parameters:
depthFormat
- the format
-
getFrameBufferDepthFormat
Returns the depth format currently used for the internal frame buffer's depth buffer- Returns:
- the depth format
-
write
- Specified by:
write
in interfaceSavable
- Throws:
IOException
-
read
- Specified by:
read
in interfaceSavable
- Throws:
IOException
-
getDepthTexture
For internal use only
returns the depth texture of the scene- Returns:
- the depth texture
-
getFilterTexture
For internal use only
returns the rendered texture of the scene- Returns:
- the filter texture
-
getFilter
returns the first filter in the list assignable from the given type- Type Parameters:
T
- the filter type- Parameters:
filterType
- the filter type- Returns:
- a filter assignable from the given type
-
getFilterList
returns an unmodifiable version of the filter list.- Returns:
- the filters list
-