Class BloomFilter

java.lang.Object
com.jme3.post.Filter
com.jme3.post.filters.BloomFilter
All Implemented Interfaces:
Savable

public class BloomFilter extends Filter
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
  • Constructor Details

    • BloomFilter

      public BloomFilter()
      Creates a Bloom filter
    • BloomFilter

      public BloomFilter(BloomFilter.GlowMode glowMode)
      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 class Filter
      Parameters:
      manager - the assetManager
      renderManager - the renderManager
      vp - the viewPort where this filter is rendered
      w - the width of the filter
      h - the height of the filter
    • reInitFilter

      protected void reInitFilter()
    • getMaterial

      protected Material getMaterial()
      Description copied from class: Filter
      Must return the material used for this filter. this method is called every frame.
      Specified by:
      getMaterial in class Filter
      Returns:
      the material used for this filter.
    • postQueue

      protected void postQueue(RenderQueue queue)
      Description copied from class: Filter
      Override this method if you want to make a pre pass, before the actual rendering of the frame
      Overrides:
      postQueue in class Filter
      Parameters:
      queue - the RenderQueue
    • cleanUpFilter

      protected void cleanUpFilter(Renderer r)
      Description copied from class: Filter
      override this method if you have some cleanup to do
      Overrides:
      cleanUpFilter in class Filter
      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 see setExposureCutOff(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 see setExposurePower(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 see setDownSamplingFactor(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

      public void write(JmeExporter ex) throws IOException
      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 interface Savable
      Overrides:
      write in class Filter
      Parameters:
      ex - the exporter (not null)
      Throws:
      IOException - from the exporter
    • read

      public void read(JmeImporter im) throws IOException
      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 interface Savable
      Overrides:
      read in class Filter
      Throws:
      IOException