Package com.jme3.post.filters
Class LightScatteringFilter
java.lang.Object
com.jme3.post.Filter
com.jme3.post.filters.LightScatteringFilter
- All Implemented Interfaces:
com.jme3.export.Savable
public class LightScatteringFilter
extends com.jme3.post.Filter
LightScattering filters create rays coming from light sources
This is often referred to as god rays.
- Author:
- Rémy Bouquet aka Nehon
-
Nested Class Summary
Nested classes/interfaces inherited from class com.jme3.post.Filter
com.jme3.post.Filter.Pass -
Field Summary
Fields inherited from class com.jme3.post.Filter
defaultPass, enabled, material, postRenderPasses, processor -
Constructor Summary
ConstructorsConstructorDescriptioncreates a lightScattering filterLightScatteringFilter(com.jme3.math.Vector3f lightPosition) Creates a lightScatteringFilter -
Method Summary
Modifier and TypeMethodDescriptionfloatreturns the blur start of the scattering seesetBlurStart(float blurStart)floatreturns the blur width
seesetBlurWidth(float blurWidth)floatreturns the light density seesetLightDensity(float lightDensity)com.jme3.math.Vector3freturns the light positionprotected com.jme3.material.Materialintreturns the number of samples for the radial blurprotected voidinitFilter(com.jme3.asset.AssetManager manager, com.jme3.renderer.RenderManager renderManager, com.jme3.renderer.ViewPort vp, int w, int h) protected booleanprotected voidpostQueue(com.jme3.renderer.queue.RenderQueue queue) voidread(com.jme3.export.JmeImporter im) voidsetBlurStart(float blurStart) sets the blur start
at which distance from the light source the effect starts default is 0.02voidsetBlurWidth(float blurWidth) sets the blur width default is 0.9voidsetLightDensity(float lightDensity) sets how much the effect is visible over the rendered scene default is 1.4voidsetLightPosition(com.jme3.math.Vector3f lightPosition) sets the light positionvoidsetNbSamples(int nbSamples) sets the number of samples for the radial blur default is 50 the higher the value the higher the quality, but the slower the performance.voidwrite(com.jme3.export.JmeExporter ex) Methods inherited from class com.jme3.post.Filter
cleanup, cleanUpFilter, getDefaultPassDepthFormat, getDefaultPassTextureFormat, getName, getPostRenderPasses, getRenderedTexture, getRenderFrameBuffer, init, isEnabled, isRequiresBilinear, isRequiresSceneTexture, postFilter, postFrame, preFrame, setDepthTexture, setEnabled, setName, setProcessor, setRenderedTexture, setRenderFrameBuffer
-
Constructor Details
-
LightScatteringFilter
public LightScatteringFilter()creates a lightScattering filter -
LightScatteringFilter
public LightScatteringFilter(com.jme3.math.Vector3f lightPosition) Creates a lightScatteringFilter- Parameters:
lightPosition- the desired location (in world coordinates, alias created)
-
-
Method Details
-
isRequiresDepthTexture
protected boolean isRequiresDepthTexture()- Overrides:
isRequiresDepthTexturein classcom.jme3.post.Filter
-
getMaterial
protected com.jme3.material.Material getMaterial()- Specified by:
getMaterialin classcom.jme3.post.Filter
-
postQueue
protected void postQueue(com.jme3.renderer.queue.RenderQueue queue) - Overrides:
postQueuein classcom.jme3.post.Filter
-
initFilter
protected void initFilter(com.jme3.asset.AssetManager manager, com.jme3.renderer.RenderManager renderManager, com.jme3.renderer.ViewPort vp, int w, int h) - Specified by:
initFilterin classcom.jme3.post.Filter
-
getBlurStart
public float getBlurStart()returns the blur start of the scattering seesetBlurStart(float blurStart)- Returns:
- the start distance
-
setBlurStart
public void setBlurStart(float blurStart) sets the blur start
at which distance from the light source the effect starts default is 0.02- Parameters:
blurStart- the desired start distance (in world units, default=0.02)
-
getBlurWidth
public float getBlurWidth()returns the blur width
seesetBlurWidth(float blurWidth)- Returns:
- the width
-
setBlurWidth
public void setBlurWidth(float blurWidth) sets the blur width default is 0.9- Parameters:
blurWidth- the desired width (default=0.9)
-
getLightDensity
public float getLightDensity()returns the light density seesetLightDensity(float lightDensity)- Returns:
- the density
-
setLightDensity
public void setLightDensity(float lightDensity) sets how much the effect is visible over the rendered scene default is 1.4- Parameters:
lightDensity- the desired density (default=1.4)
-
getLightPosition
public com.jme3.math.Vector3f getLightPosition()returns the light position- Returns:
- the pre-existing vector
-
setLightPosition
public void setLightPosition(com.jme3.math.Vector3f lightPosition) sets the light position- Parameters:
lightPosition- the desired location (in world coordinates, alias created)
-
getNbSamples
public int getNbSamples()returns the number of samples for the radial blur- Returns:
- count (≥0)
-
setNbSamples
public void setNbSamples(int nbSamples) sets the number of samples for the radial blur default is 50 the higher the value the higher the quality, but the slower the performance.- Parameters:
nbSamples- the desired number of samples (default=50)
-
write
- Specified by:
writein interfacecom.jme3.export.Savable- Overrides:
writein classcom.jme3.post.Filter- Throws:
IOException
-
read
- Specified by:
readin interfacecom.jme3.export.Savable- Overrides:
readin classcom.jme3.post.Filter- Throws:
IOException
-