Package arc.graphics.g2d
Class Bloom
java.lang.Object
arc.graphics.g2d.Bloom
Requires bloom shaders in 'bloomshaders' folder.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionBloom()
Creates a bloom instance with no blending, no depth and 1/4 the screen size.Bloom
(boolean useBlending) Bloom
(int width, int height, boolean hasDepth, boolean useBlending) Initializes bloom class that encapsulates original scene capturate, thresholding, gaussian blurring and blending. -
Method Summary
Modifier and TypeMethodDescriptionbuffer()
void
capture()
Call this before rendering scene.void
Start capturing again after pause, no clearing is done to the buffer.void
Pause capturing to the buffer.void
dispose()
Disposes all resources.void
render()
Renders the bloomed scene.void
resize
(int width, int height) void
resize
(int width, int height, int scaling) void
resume()
Rebinds the context.void
setBloomIntensity
(float intensity) Set intensity for bloom.void
setBloomIntesity
(float intensity) Deprecated.void
setClearColor
(float r, float g, float b, float a) Set clearing color for capturing buffer.void
setOriginalIntensity
(float intensity) Set intensity for original scene.void
setOriginalIntesity
(float intensity) Deprecated.void
setThreshold
(float threshold) Threshold for bright parts.
-
Field Details
-
blurPasses
public int blurPasses -
blending
public boolean blending
-
-
Constructor Details
-
Bloom
public Bloom()Creates a bloom instance with no blending, no depth and 1/4 the screen size. -
Bloom
public Bloom(boolean useBlending) -
Bloom
public Bloom(int width, int height, boolean hasDepth, boolean useBlending) Initializes bloom class that encapsulates original scene capturate, thresholding, gaussian blurring and blending.- Parameters:
hasDepth
- Enables depth buffer.useBlending
- Enables alpha blending, allowing combining background graphics and only doing blooming on certain objects.
-
-
Method Details
-
resume
public void resume()Rebinds the context. Necessary on Android/IOS. TODO or is it? -
resize
public void resize(int width, int height) -
resize
public void resize(int width, int height, int scaling) -
setClearColor
public void setClearColor(float r, float g, float b, float a) Set clearing color for capturing buffer. -
capture
public void capture()Call this before rendering scene. -
capturePause
public void capturePause()Pause capturing to the buffer. -
captureContinue
public void captureContinue()Start capturing again after pause, no clearing is done to the buffer. -
render
public void render()Renders the bloomed scene. -
setBloomIntesity
Deprecated. -
setOriginalIntesity
Deprecated. -
setBloomIntensity
public void setBloomIntensity(float intensity) Set intensity for bloom. Higher means more brightening for spots that are over threshold.- Parameters:
intensity
- Multiplier for blurred texture in combining phase. Must be positive.
-
setOriginalIntensity
public void setOriginalIntensity(float intensity) Set intensity for original scene. Under 1 means darkening and over 1 means lightening.- Parameters:
intensity
- Multiplier for captured texture in combining phase. Must be positive.
-
setThreshold
public void setThreshold(float threshold) Threshold for bright parts. Everything under threshold is set to 0.- Parameters:
threshold
- Must be in range [0..1].
-
buffer
- Returns:
- The unprocessed frame buffer this bloom captures. Advanced uses only.
-
dispose
public void dispose()Disposes all resources.
-