|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme3.post.Filter
com.jme3.post.filters.PosterizationFilter
public class PosterizationFilter
A Post Processing filter to change colors appear with sharp edges as if the available amount of colors available was not enough to draw the true image. Possibly useful in cartoon styled games. Use the strength variable to lessen influence of this filter on the total result. Values from 0.2 to 0.7 appear to give nice results. Based on an article from Geeks3D: http://www.geeks3d.com/20091027/shader-library-posterization-post-processing-effect-glsl/
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 | |
---|---|
PosterizationFilter()
Creates a posterization Filter |
|
PosterizationFilter(int numColors)
Creates a posterization Filter with the given number of colors |
|
PosterizationFilter(int numColors,
float gamma)
Creates a posterization Filter with the given number of colors and gamma |
Method Summary | |
---|---|
float |
getGamma()
Returns current gamma value |
protected Material |
getMaterial()
Must return the material used for this filter. |
int |
getNumColors()
Returns number of color levels used |
float |
getStrength()
Returns current strength value, i.e. |
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 |
setGamma(float gamma)
Sets gamma level used to enhange visual quality |
void |
setNumColors(int numColors)
Sets number of color levels used to draw the screen |
void |
setStrength(float strength)
Sets urrent strength value, i.e. |
Methods inherited from class com.jme3.post.Filter |
---|
cleanup, cleanUpFilter, getDefaultPassDepthFormat, getDefaultPassTextureFormat, getName, getPostRenderPasses, getRenderedTexture, getRenderFrameBuffer, init, isEnabled, isRequiresDepthTexture, isRequiresSceneTexture, postFrame, postQueue, preFrame, read, setDepthTexture, setEnabled, setName, setProcessor, setRenderedTexture, setRenderFrameBuffer, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PosterizationFilter()
public PosterizationFilter(int numColors)
numColors
- public PosterizationFilter(int numColors, float gamma)
numColors
- gamma
- Method Detail |
---|
protected void initFilter(AssetManager manager, RenderManager renderManager, ViewPort vp, int w, int h)
Filter
initFilter
in class Filter
manager
- the assetManagerrenderManager
- the renderManagervp
- the viewPort where this filter is renderedw
- the width of the filterh
- the height of the filterprotected Material getMaterial()
Filter
getMaterial
in class Filter
public void setNumColors(int numColors)
public void setGamma(float gamma)
public void setStrength(float strength)
public int getNumColors()
public float getGamma()
public float getStrength()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |