com.threed.jpct
Class BloomGLProcessor

java.lang.Object
  extended bycom.threed.jpct.BloomGLProcessor
All Implemented Interfaces:
IPostProcessor

public class BloomGLProcessor
extends java.lang.Object
implements IPostProcessor

An implementation of an IPostProcessor what implements a bloom effect (kind of pseudo-HDR) for the OpenGL renderer. When run on a software renderer's framebuffer, it's giving a warning once and does nothing afterwards.
The bloom effect can be configured by various variables in the constructor.


Constructor Summary
BloomGLProcessor()
          Creates a bloom effect with default settings.
BloomGLProcessor(int darkening, int blur, int strength, int quality)
          Creates a bloom effect on the framebuffer's content.
 
Method Summary
 void dispose()
          Will be called when a post processor gets removed from a framebuffer and should be called, when the processor gets garbage collected.
 void finalize()
           
 void init(FrameBuffer buffer)
          Initialize the processor.
 boolean isInitialized()
          Has to return true if the init()-method has run correctly and should return false after the processor has been disposed (but doesn't have to, if an implementation requires something else...no problem).
 void process()
          Does the actual processing.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BloomGLProcessor

public BloomGLProcessor()
Creates a bloom effect with default settings.


BloomGLProcessor

public BloomGLProcessor(int darkening,
                        int blur,
                        int strength,
                        int quality)
Creates a bloom effect on the framebuffer's content.

Parameters:
darkening - The higher this value, the more the bright areas will be affected only. The lower it is, the more bloom effect even not so bright areas of the screen will get. Increasing this value slows down the process.
blur - Increasing this values leads to a higher blur but slower performance. Increasing it to very high values leads to strange artifacts.
strength - This controls the "strength" of the effect, i.e. how much the "bloomed" image affects the actual rendering. Increasing it slows down the processs.
quality - Increasing this value lowers(!) the quality of the texture map used to do the post processing. 0 means that the texture has the same size as the framebuffer, 1 means it's a quarter of that size, 2 an eighth...Reasonable value are 1 and 2. The higher the value, the higher the demand for fillrate, i.e. the slower.
Method Detail

init

public void init(FrameBuffer buffer)
Description copied from interface: IPostProcessor
Initialize the processor. Because it has to work on the framebuffer, it should be bound to it. I.e. you shouldn't write a post processor which can be run on multiple framebuffers at a time albeit it's up the actual implementation to ensure this. All the framework does, is to check if isInitialized() returns true, so this method has to ensure that this is the case to prevent all kinds of strange bugs and multi initialization calls.
This method will be called on the first call of the post processor, not when adding it to a framebuffer.

Specified by:
init in interface IPostProcessor
Parameters:
buffer - the FrameBuffer

isInitialized

public boolean isInitialized()
Description copied from interface: IPostProcessor
Has to return true if the init()-method has run correctly and should return false after the processor has been disposed (but doesn't have to, if an implementation requires something else...no problem).

Specified by:
isInitialized in interface IPostProcessor
Returns:
boolean is it initialized?

process

public void process()
Description copied from interface: IPostProcessor
Does the actual processing. It's totally up to the implementation what happens here.

Specified by:
process in interface IPostProcessor

dispose

public void dispose()
Description copied from interface: IPostProcessor
Will be called when a post processor gets removed from a framebuffer and should be called, when the processor gets garbage collected. A processor will implicitly be removed from a framebuffer if a renderer gets enabled or disabled on it.

Specified by:
dispose in interface IPostProcessor

finalize

public void finalize()