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
Filters 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
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDon't use this constructor, useFilterPostProcessor(AssetManager assetManager)
This constructor is used for serialization onlyFilterPostProcessor(AssetManager assetManager) Create a FilterProcessor -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a filter to the filters listvoidcleanup()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 bufferintreturn the number of samples for antialiasingvoidinitialize(RenderManager rm, ViewPort vp) Called in the render thread to initialize the scene processor.booleanvoidpostFrame(FrameBuffer out) Called after a frame has been rendered and the queue flushed.voidpostQueue(RenderQueue rq) Called after the scene graph has been queued, but before it is flushed.voidpreFrame(float tpf) Called before a framevoidread(JmeImporter im) voidRemoves all the filters from this processorvoidremoveFilter(Filter filter) removes this filters from the filters listvoidCalled when the resolution of the viewport has been changed.voidsetAssetManager(AssetManager assetManager) Sets the asset manager for this processorprotected voidsetFilterState(Filter filter, boolean enabled) sets the filter to enabled or disabledvoidsetFrameBufferDepthFormat(Image.Format depthFormat) Sets the format to be used for the internal frame buffer's depth buffervoidsetFrameBufferFormat(Image.Format fbFormat) Sets the format to be used for the internal frame buffer's color buffervoidsetNumSamples(int numSamples) Sets the number of samples for antialiasingvoidsetProfiler(AppProfiler profiler) Sets a profiler Instance for this processor.voidwrite(JmeExporter ex) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:SceneProcessorCalled in the render thread to initialize the scene processor.- Specified by:
initializein 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:
isInitializedin interfaceSceneProcessor- Returns:
- True if initialize() has been called on this SceneProcessor, false if otherwise.
-
postQueue
Description copied from interface:SceneProcessorCalled after the scene graph has been queued, but before it is flushed.- Specified by:
postQueuein interfaceSceneProcessor- Parameters:
rq- The render queue
-
postFrame
Description copied from interface:SceneProcessorCalled after a frame has been rendered and the queue flushed.- Specified by:
postFramein interfaceSceneProcessor- Parameters:
out- The FB to which the scene was rendered.
-
preFrame
public void preFrame(float tpf) Description copied from interface:SceneProcessorCalled before a frame- Specified by:
preFramein 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:SceneProcessorCalled when the SP is removed from the RM.- Specified by:
cleanupin interfaceSceneProcessor
-
setProfiler
Description copied from interface:SceneProcessorSets a profiler Instance for this processor.- Specified by:
setProfilerin interfaceSceneProcessor- Parameters:
profiler- the profiler instance.
-
reshape
Description copied from interface:SceneProcessorCalled when the resolution of the viewport has been changed.- Specified by:
reshapein 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:
writein interfaceSavable- Throws:
IOException
-
read
- Specified by:
readin 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
-