|
||||||||||
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.CrossHatchFilter
public class CrossHatchFilter
A Post Processing filter that makes the screen look like it was drawn as diagonal lines with a pen. Try combining this with a cartoon edge filter to obtain manga style visuals. Based on an article from Geeks3D: http://www.geeks3d.com/20110219/shader-library-crosshatching-glsl-filter/
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 | |
---|---|
CrossHatchFilter()
Creates a crossHatch filter |
|
CrossHatchFilter(ColorRGBA lineColor,
ColorRGBA paperColor)
Creates a crossHatch filter |
Method Summary | |
---|---|
float |
getColorInfluenceLine()
Returns current influence of image colors on lines |
float |
getColorInfluencePaper()
Returns current influence of image colors on paper background |
float |
getFillValue()
Returns line/paper color ratio for blobs |
ColorRGBA |
getLineColor()
Returns line color |
float |
getLineDistance()
Returns minimum distance between lines |
float |
getLineThickness()
Returns the thickness of the lines drawn |
float |
getLuminance1()
Returns treshold for lines 1 |
float |
getLuminance2()
Returns treshold for lines 2 |
float |
getLuminance3()
Returns treshold for lines 3 |
float |
getLuminance4()
Returns treshold for lines 4 |
float |
getLuminance5()
Returns treshold for blobs |
protected Material |
getMaterial()
Must return the material used for this filter. |
ColorRGBA |
getPaperColor()
Returns paper background color |
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 |
protected boolean |
isRequiresDepthTexture()
Override this method and return true if your Filter needs the depth texture |
void |
setColorInfluenceLine(float colorInfluenceLine)
Sets color influence of original image on lines drawn |
void |
setColorInfluencePaper(float colorInfluencePaper)
Sets color influence of original image on non-line areas |
void |
setFillValue(float fillValue)
Sets line/paper color ratio for areas with values < luminance5, really dark areas get no lines but a filled blob instead |
void |
setLineColor(ColorRGBA lineColor)
Sets color used to draw lines |
void |
setLineDistance(float lineDistance)
Sets minimum distance between lines drawn Primary lines are drawn at 2*lineDistance Secondary lines are drawn at lineDistance |
void |
setLineThickness(float lineThickness)
Sets the thickness of lines drawn |
void |
setLuminanceLevels(float luminance1,
float luminance2,
float luminance3,
float luminance4,
float luminance5)
Sets minimum luminance levels for lines drawn |
void |
setPaperColor(ColorRGBA paperColor)
Sets color used as background |
Methods inherited from class com.jme3.post.Filter |
---|
cleanup, cleanUpFilter, getDefaultPassDepthFormat, getDefaultPassTextureFormat, getName, getPostRenderPasses, getRenderedTexture, getRenderFrameBuffer, init, isEnabled, 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 CrossHatchFilter()
public CrossHatchFilter(ColorRGBA lineColor, ColorRGBA paperColor)
lineColor
- the colors of the linespaperColor
- the paper colorMethod Detail |
---|
protected boolean isRequiresDepthTexture()
Filter
isRequiresDepthTexture
in class Filter
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 setLineColor(ColorRGBA lineColor)
lineColor
- public void setPaperColor(ColorRGBA paperColor)
paperColor
- public void setColorInfluenceLine(float colorInfluenceLine)
colorInfluenceLine
- public void setColorInfluencePaper(float colorInfluencePaper)
colorInfluencePaper
- public void setFillValue(float fillValue)
fillValue
- public void setLuminanceLevels(float luminance1, float luminance2, float luminance3, float luminance4, float luminance5)
luminance1
- Top-left to down right 1luminance2
- Top-right to bottom left 1luminance3
- Top-left to down right 2luminance4
- Top-right to bottom left 2luminance5
- Blobspublic void setLineThickness(float lineThickness)
lineThickness
- public void setLineDistance(float lineDistance)
lineDistance
- public ColorRGBA getLineColor()
public ColorRGBA getPaperColor()
public float getColorInfluenceLine()
public float getColorInfluencePaper()
public float getFillValue()
public float getLineThickness()
public float getLineDistance()
public float getLuminance1()
public float getLuminance2()
public float getLuminance3()
public float getLuminance4()
public float getLuminance5()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |