public abstract class Filter extends java.lang.Object implements Savable
Modifier and Type | Class and Description |
---|---|
class |
Filter.Pass
Inner class Pass
Pass are like filters in filters.
|
Modifier and Type | Field and Description |
---|---|
protected Filter.Pass |
defaultPass |
protected boolean |
enabled |
protected Material |
material |
protected java.util.List<Filter.Pass> |
postRenderPasses |
protected FilterPostProcessor |
processor |
Modifier | Constructor and Description |
---|---|
protected |
Filter()
construct a Filter
|
|
Filter(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
protected void |
cleanup(Renderer r)
cleanup this filter
|
protected void |
cleanUpFilter(Renderer r)
override this method if you have some cleanup to do
|
protected Image.Format |
getDefaultPassDepthFormat()
returns the default pass depth format
|
protected Image.Format |
getDefaultPassTextureFormat()
returns the default pass texture format.
|
protected abstract Material |
getMaterial()
Must return the material used for this filter.
|
java.lang.String |
getName()
returns the name of the filter
|
protected java.util.List<Filter.Pass> |
getPostRenderPasses()
returns the list of the postRender passes
|
protected Texture2D |
getRenderedTexture()
returns the rendered texture of this filter
|
protected FrameBuffer |
getRenderFrameBuffer()
returns the default pass frame buffer
|
protected void |
init(AssetManager manager,
RenderManager renderManager,
ViewPort vp,
int w,
int h)
initialize this filter
use InitFilter for overriding filter initialization
|
protected abstract 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
|
boolean |
isEnabled()
returns true if the filter is enabled
|
protected boolean |
isRequiresBilinear()
Override this method and return true if you want the scene (input) texture
to use bilinear filtering or false to use nearest filtering.
|
protected boolean |
isRequiresDepthTexture()
Override this method and return true if your Filter needs the depth texture
|
protected boolean |
isRequiresSceneTexture()
Override this method and return false if your Filter does not need the scene texture
|
protected void |
postFilter(Renderer r,
FrameBuffer buffer)
This method is called right after the filter has been rendered to the
framebuffer.
|
protected void |
postFrame(RenderManager renderManager,
ViewPort viewPort,
FrameBuffer prevFilterBuffer,
FrameBuffer sceneBuffer)
Override this method if you want to make a pass just after the frame has been rendered and just before the filter rendering
|
protected void |
postQueue(RenderQueue queue)
Override this method if you want to make a pre pass, before the actual rendering of the frame
|
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);
|
protected void |
setDepthTexture(Texture depthTexture)
Override if you want to do something special with the depth texture;
|
void |
setEnabled(boolean enabled)
Enable or disable this filter
|
void |
setName(java.lang.String name)
Sets the name of the filter
|
protected void |
setProcessor(FilterPostProcessor proc)
sets a reference to the FilterPostProcessor to which this filter is attached
|
protected void |
setRenderedTexture(Texture2D renderedTexture)
sets the rendered texture of this filter
|
protected void |
setRenderFrameBuffer(FrameBuffer renderFrameBuffer)
sets the default pass frame buffer
|
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);
|
protected Filter.Pass defaultPass
protected java.util.List<Filter.Pass> postRenderPasses
protected Material material
protected boolean enabled
protected FilterPostProcessor processor
public Filter(java.lang.String name)
protected Filter()
protected Image.Format getDefaultPassTextureFormat()
protected Image.Format getDefaultPassDepthFormat()
protected final void init(AssetManager manager, RenderManager renderManager, ViewPort vp, int w, int h)
manager
- the assetManagerrenderManager
- the renderManagervp
- the viewportw
- the widthh
- the heightprotected final void cleanup(Renderer r)
r
- protected abstract void initFilter(AssetManager manager, RenderManager renderManager, ViewPort vp, int w, int h)
manager
- the assetManagerrenderManager
- the renderManagervp
- the viewPort where this filter is renderedw
- the width of the filterh
- the height of the filterprotected void cleanUpFilter(Renderer r)
r
- the rendererprotected abstract Material getMaterial()
protected void setDepthTexture(Texture depthTexture)
depthTexture
- protected void postQueue(RenderQueue queue)
queue
- protected void preFrame(float tpf)
tpf
- the time used to render the previous frameprotected void postFrame(RenderManager renderManager, ViewPort viewPort, FrameBuffer prevFilterBuffer, FrameBuffer sceneBuffer)
renderManager
- viewPort
- prevFilterBuffer
- sceneBuffer
- public void write(JmeExporter ex) throws java.io.IOException
public void read(JmeImporter im) throws java.io.IOException
public java.lang.String getName()
public void setName(java.lang.String name)
name
- protected FrameBuffer getRenderFrameBuffer()
protected void setRenderFrameBuffer(FrameBuffer renderFrameBuffer)
renderFrameBuffer
- protected Texture2D getRenderedTexture()
protected void setRenderedTexture(Texture2D renderedTexture)
renderedTexture
- protected boolean isRequiresDepthTexture()
protected boolean isRequiresSceneTexture()
protected boolean isRequiresBilinear()
protected java.util.List<Filter.Pass> getPostRenderPasses()
public void setEnabled(boolean enabled)
enabled
- true to enablepublic boolean isEnabled()
protected void setProcessor(FilterPostProcessor proc)
proc
- protected void postFilter(Renderer r, FrameBuffer buffer)
r
- the rendererbuffer
- the framebuffer on which the filter has been rendered.