Class SoftBloomFilter
- All Implemented Interfaces:
- Savable
 Compared to BloomFilter, this filter produces much higher quality
 results that feel much more natural.
 
This implementation, unlike BloomFilter, has no brightness threshold, meaning all aspects of the scene glow, although only very bright areas will noticeably produce glow. For this reason, this filter should only be used if HDR is also being utilized, otherwise BloomFilter should be preferred.
This filter uses the PBR bloom algorithm presented in this article.
- 
Nested Class SummaryNested classes/interfaces inherited from class com.jme3.post.FilterFilter.Pass
- 
Field SummaryFields inherited from class com.jme3.post.FilterdefaultPass, enabled, material, postRenderPasses, processor
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionfloatGets the glow factor.protected MaterialMust return the material used for this filter.intGets the number of downsampling/upsampling passes per step.protected voidinitFilter(AssetManager am, RenderManager rm, ViewPort vp, int w, int h) Initialization of filter subclasses.booleanReturns true if pass textures use bilinear filtering.voidread(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);voidsetBilinearFiltering(boolean bilinearFiltering) Sets pass textures to use bilinear filtering.voidsetGlowFactor(float factor) Sets the factor at which the glow result texture is merged with the scene texture.voidsetNumSamplingPasses(int numSamplingPasses) Sets the number of sampling passes in each step.voidwrite(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.Filtercleanup, cleanUpFilter, getDefaultPassDepthFormat, getDefaultPassTextureFormat, getName, getPostRenderPasses, getRenderedTexture, getRenderFrameBuffer, init, isEnabled, isRequiresBilinear, isRequiresDepthTexture, isRequiresSceneTexture, postFilter, postFrame, postQueue, preFrame, setDepthTexture, setEnabled, setName, setProcessor, setRenderedTexture, setRenderFrameBuffer
- 
Constructor Details- 
SoftBloomFilterpublic SoftBloomFilter()Creates filter with default settings.
 
- 
- 
Method Details- 
initFilterDescription copied from class:FilterInitialization 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:
- initFilterin class- Filter
- Parameters:
- am- the assetManager
- rm- the renderManager
- vp- the viewPort where this filter is rendered
- w- the width of the filter
- h- the height of the filter
 
- 
getMaterialDescription copied from class:FilterMust return the material used for this filter. this method is called every frame.- Specified by:
- getMaterialin class- Filter
- Returns:
- the material used for this filter.
 
- 
setNumSamplingPassespublic void setNumSamplingPasses(int numSamplingPasses) Sets the number of sampling passes in each step.Higher values produce more glow with higher resolution, at the cost of more passes. Lower values produce less glow with lower resolution. The total number of passes is 2n+1: n passes for downsampling (13 texture reads per pass per fragment), n passes for upsampling and blur (9 texture reads per pass per fragment), and 1 pass for blending (2 texture reads per fragment). Though, it should be noted that for each downsampling pass the number of fragments decreases by 75%, and for each upsampling pass, the number of fragments quadruples (which restores the number of fragments to the original resolution).Setting this after the filter has been initialized forces reinitialization. default=5 - Parameters:
- numSamplingPasses- The number of passes per donwsampling/upsampling step. Must be greater than zero.
- Throws:
- IllegalArgumentException- if argument is less than or equal to zero
 
- 
setGlowFactorpublic void setGlowFactor(float factor) Sets the factor at which the glow result texture is merged with the scene texture.Low values favor the scene texture more, while high values make glow more noticeable. This value is clamped between 0 and 1. default=0.05f - Parameters:
- factor-
 
- 
setBilinearFilteringpublic void setBilinearFiltering(boolean bilinearFiltering) Sets pass textures to use bilinear filtering.If true, downsampling textures are set to min=BilinearNoMipMapsand upsampling textures are set tomag=Bilinear, which produces better quality glow. If false, textures use their default filters.default=true - Parameters:
- bilinearFiltering- true to use bilinear filtering
 
- 
getNumSamplingPassespublic int getNumSamplingPasses()Gets the number of downsampling/upsampling passes per step.- Returns:
- number of downsampling/upsampling passes
- See Also:
 
- 
getGlowFactorpublic float getGlowFactor()Gets the glow factor.- Returns:
- glow factor
- See Also:
 
- 
isBilinearFilteringpublic boolean isBilinearFiltering()Returns true if pass textures use bilinear filtering.- Returns:
- See Also:
 
- 
writeDescription copied from class:FilterOverride 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:
- writein interface- Savable
- Overrides:
- writein class- Filter
- Parameters:
- ex- the exporter (not null)
- Throws:
- IOException- from the exporter
 
- 
readDescription copied from class:FilterOverride 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:
- readin interface- Savable
- Overrides:
- readin class- Filter
- Throws:
- IOException
 
 
-