Package com.jme3.post.filters
Class BloomFilter
java.lang.Object
com.jme3.post.Filter
com.jme3.post.filters.BloomFilter
- All Implemented Interfaces:
Savable
BloomFilter is used to make objects in the scene have a glow effect.
There are 2 mode : Scene and Objects.
Scene mode extracts the bright parts of the scene to make them glow
Object mode makes objects glow according to their material's glowMap or their GlowColor
See advanced:bloom_and_glow for more details
There are 2 mode : Scene and Objects.
Scene mode extracts the bright parts of the scene to make them glow
Object mode makes objects glow according to their material's glowMap or their GlowColor
See advanced:bloom_and_glow for more details
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
GlowMode specifies if the glow will be applied to the whole scene or to objects that have a glow color or a glow mapNested 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
ConstructorDescriptionCreates a Bloom filterBloomFilter
(BloomFilter.GlowMode glowMode) Creates the bloom filter with the specified glow mode -
Method Summary
Modifier and TypeMethodDescriptionprotected void
override this method if you have some cleanup to dofloat
returns the bloom intensityfloat
returns the blur scalefloat
returns the downSampling factor
for more details seesetDownSamplingFactor(float downSamplingFactor)
float
returns the exposure cutoff
for more details seesetExposureCutOff(float exposureCutOff)
float
returns the exposure power
for more details seesetExposurePower(float exposurePower)
protected Material
Must return the material used for this filter.protected void
initFilter
(AssetManager manager, RenderManager renderManager, ViewPort vp, int w, int h) Initialization of filter subclasses.protected void
postQueue
(RenderQueue queue) Override this method if you want to make a pre pass, before the actual rendering of the framevoid
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
void
setBloomIntensity
(float bloomIntensity) intensity of the bloom effect default is 2.0void
setBlurScale
(float blurScale) sets The spread of the bloom default is 1.5fvoid
setDownSamplingFactor
(float downSamplingFactor) Sets the downSampling factor : the size of the computed texture will be divided by this factor.void
setExposureCutOff
(float exposureCutOff) Define the color threshold on which the bloom will be applied (0.0 to 1.0)void
setExposurePower
(float exposurePower) defines how many times the bloom extracted color will be multiplied by itself.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);Methods inherited from class com.jme3.post.Filter
cleanup, getDefaultPassDepthFormat, getDefaultPassTextureFormat, getName, getPostRenderPasses, getRenderedTexture, getRenderFrameBuffer, init, isEnabled, isRequiresBilinear, isRequiresDepthTexture, isRequiresSceneTexture, postFilter, postFrame, preFrame, setDepthTexture, setEnabled, setName, setProcessor, setRenderedTexture, setRenderFrameBuffer
-
Constructor Details
-
BloomFilter
public BloomFilter()Creates a Bloom filter -
BloomFilter
Creates the bloom filter with the specified glow mode- Parameters:
glowMode
- the desired mode (default=Scene)
-
-
Method Details
-
initFilter
protected void initFilter(AssetManager manager, RenderManager renderManager, ViewPort vp, int w, int h) Description copied from class:Filter
Initialization of filter subclasses. This method is called once when the filter is added to the FilterPostProcessor It should contain Material initializations and extra passes initialization- Specified by:
initFilter
in classFilter
- Parameters:
manager
- the assetManagerrenderManager
- the renderManagervp
- the viewPort where this filter is renderedw
- the width of the filterh
- the height of the filter
-
reInitFilter
protected void reInitFilter() -
getMaterial
Description copied from class:Filter
Must return the material used for this filter. this method is called every frame.- Specified by:
getMaterial
in classFilter
- Returns:
- the material used for this filter.
-
postQueue
Description copied from class:Filter
Override this method if you want to make a pre pass, before the actual rendering of the frame -
cleanUpFilter
Description copied from class:Filter
override this method if you have some cleanup to do- Overrides:
cleanUpFilter
in classFilter
- Parameters:
r
- the renderer
-
getBloomIntensity
public float getBloomIntensity()returns the bloom intensity- Returns:
- the intensity value
-
setBloomIntensity
public void setBloomIntensity(float bloomIntensity) intensity of the bloom effect default is 2.0- Parameters:
bloomIntensity
- the desired intensity (default=2)
-
getBlurScale
public float getBlurScale()returns the blur scale- Returns:
- the blur scale
-
setBlurScale
public void setBlurScale(float blurScale) sets The spread of the bloom default is 1.5f- Parameters:
blurScale
- the desired scale (default=1.5)
-
getExposureCutOff
public float getExposureCutOff()returns the exposure cutoff
for more details seesetExposureCutOff(float exposureCutOff)
- Returns:
- the exposure cutoff
-
setExposureCutOff
public void setExposureCutOff(float exposureCutOff) Define the color threshold on which the bloom will be applied (0.0 to 1.0)- Parameters:
exposureCutOff
- the desired threshold (≥0, ≤1, default=0)
-
getExposurePower
public float getExposurePower()returns the exposure power
for more details seesetExposurePower(float exposurePower)
- Returns:
- the exposure power
-
setExposurePower
public void setExposurePower(float exposurePower) defines how many times the bloom extracted color will be multiplied by itself. default is 5.0
a high value will reduce rough edges in the bloom and somehow the range of the bloom area- Parameters:
exposurePower
- the desired exponent (default=5)
-
getDownSamplingFactor
public float getDownSamplingFactor()returns the downSampling factor
for more details seesetDownSamplingFactor(float downSamplingFactor)
- Returns:
- the downsampling factor
-
setDownSamplingFactor
public void setDownSamplingFactor(float downSamplingFactor) Sets the downSampling factor : the size of the computed texture will be divided by this factor. default is 1 for no downsampling A 2 value is a good way of widening the blur- Parameters:
downSamplingFactor
- the desired factor (default=1)
-
write
Description copied from class:Filter
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);- Specified by:
write
in interfaceSavable
- Overrides:
write
in classFilter
- Parameters:
ex
- the exporter (not null)- Throws:
IOException
- from the exporter
-
read
Description copied from class:Filter
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);- Specified by:
read
in interfaceSavable
- Overrides:
read
in classFilter
- Throws:
IOException
-