Class BloomFilter

All Implemented Interfaces:

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
      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
      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
      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
      postQueue in class Filter
      queue - the RenderQueue
    • cleanUpFilter

      protected void cleanUpFilter(Renderer r)
      Description copied from class: Filter
      override this method if you have some cleanup to do
      cleanUpFilter in class Filter
      r - the renderer
    • getBloomIntensity

      public float getBloomIntensity()
      returns the bloom intensity
      the intensity value
    • setBloomIntensity

      public void setBloomIntensity(float bloomIntensity)
      intensity of the bloom effect default is 2.0
      bloomIntensity - the desired intensity (default=2)
    • getBlurScale

      public float getBlurScale()
      returns the blur scale
      the blur scale
    • setBlurScale

      public void setBlurScale(float blurScale)
      sets The spread of the bloom default is 1.5f
      blurScale - the desired scale (default=1.5)
    • getExposureCutOff

      public float getExposureCutOff()
      returns the exposure cutoff
      for more details see setExposureCutOff(float exposureCutOff)
      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)
      exposureCutOff - the desired threshold (≥0, ≤1, default=0)
    • getExposurePower

      public float getExposurePower()
      returns the exposure power
      for more details see setExposurePower(float exposurePower)
      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
      exposurePower - the desired exponent (default=5)
    • getDownSamplingFactor

      public float getDownSamplingFactor()
      returns the downSampling factor
      for more details see setDownSamplingFactor(float downSamplingFactor)
      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
      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
      write in class Filter
      ex - the exporter (not null)
      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;
      Specified by:
      read in interface Savable
      read in class Filter